Home
- Details
- Written by: po3dno
- Category: Exchange Server
- Hits: 924
Set-ServerComponentState srv1 –Component HubTransport –State Draining –Requester Maintenance
Redirect-Message -Server srv1 -Target srv2.domain.local -Confirm:$false
Suspend-ClusterNode –Name srv1
Set-MailboxServer srv1 –DatabaseCopyActivationDisabledAndMoveNow $true
Set-ServerComponentState srv1 -Component ServerWideOffline –State InActive –Requester Maintenance
setup.exe /prepareschema /IAcceptExchangeServerLicenseTerms
setup.exe /preparead /IAcceptExchangeServerLicenseTerms
setup.exe /PrepareDomain /IAcceptExchangeServerLicenseTerms
setup.exe /m:upgrade /IAcceptExchangeServerLicenseTerms
Resume-ClusterNode –Name srv1
Set-MailboxServer srv1 –DatabaseCopyAutoActivationPolicy Unrestricted
Set-MailboxServer srv1 –DatabaseCopyActivationDisabledAndMoveNow $false
Set-ServerComponentState srv1 –Component HubTransport –State Active –Requester Maintenance
Set-ServerComponentState srv1 -Component ServerWideOffline –State Active –Requester Maintenance
cd "C:\Program Files\Microsoft\Exchange Server\V15\scripts"
.\RedistributeActiveDatabases.ps1 –DagName DAG1 –BalanceDbsByActivationPreference –confirm: $false
- Details
- Written by: po3dno
- Category: MSSQL
- Hits: 812
declare @DbId as int = db_id(N'имя_базы') use [master]; select [now] = cast(sysdatetime() as datetime2(0)) /*, [db_name] = db_name(er.[database_id]) */ , es.session_id , er.[status] , er.command /*, [sql_command] = case when er.sql_handle is null then null else (select [text] from sys.dm_exec_sql_text(er.sql_handle)) end*/ , er.percent_complete , er.[wait_resource] , er.blocking_session_id , es.[program_name] , es.[host_name] , es.[login_name] , es.[nt_user_name] , er.start_time , er.[user_id] , er.connection_id from sys.dm_exec_requests er inner join sys.dm_exec_sessions es on es.[session_id] = er.[session_id] where er.database_id = @DbId ;
- Details
- Written by: po3dno
- Category: Power Shell
- Hits: 996
-
Launch PowerShell and dot source function from the
Out-Minidump.ps1
(note first dot):
. c:\path\to\Out-Minidump.ps1
- Now you can actually create dump of the process using this syntax:
Get-Process 'notepad.exe' | Out-Minidump -DumpFilePath C:\temp
- To get help, run this command:
Get-Help Out-Minidump -Full
- Details
- Written by: po3dno
- Category: Power Shell
- Hits: 841
[void][reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration")
$wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::getUpdateServer("localhost",$False)
$groupall = $wsus.GetComputerTargetGroups()
$pcall = $groupall | %{$_.GetComputerTargets()}
- Details
- Written by: po3dno
- Category: Exchange Server
- Hits: 904
Set-UserPhoto "Paul Cannon" -PictureData ([System.IO.File]::ReadAllBytes("C:\Users\Administrator\Desktop\PaulCannon.jpg"))