Patching Time – Part 2 / 3

$source=”Server01″

###Sets the server Component State to allow the queues to drain so mail doesn’t get stuck, then places in maintenance mode###

Set-ServerComponentState $source -Component HubTransport -State Active -Requester Maintenance | out-null
Set-ServerComponentState $source -Component ServerWideOffline -State active -Requester Maintenance | out-null

###These two services must be reset after setting the component state.###

Get-Service -ComputerName $source | Restart-Service -Confirm:$true -Include msexchangetransport, msexchangefrontendtransport

Resume-ClusterNode $source | out-null
Set-MailboxServer $source -DatabaseCopyActivationDisabledAndMoveNow $False | out-null
Set-MailboxServer $source -DatabaseCopyAutoActivationPolicy Unrestricted | out-null

###Verify the server properly set DatabaseCopyAutoActivationPolicy & DatabaseCopyActivationDisabledAndMoveNow correctly###

Get-MailboxServer $source | select DatabaseCopyAutoActivationPolicy, DatabaseCopyActivationDisabledAndMoveNow
Get-ExchangeServer | % { get-mailboxdatabasecopystatus -server $_.fqdn }