{"id":228,"date":"2019-07-15T08:24:48","date_gmt":"2019-07-15T12:24:48","guid":{"rendered":"http:\/\/www.thelamberts.com\/wiki\/?p=228"},"modified":"2019-10-11T15:55:09","modified_gmt":"2019-10-11T19:55:09","slug":"gracefully-patching-exchange-2016","status":"publish","type":"post","link":"http:\/\/www.thelamberts.com\/wiki\/2019\/07\/15\/gracefully-patching-exchange-2016\/","title":{"rendered":"Gracefully Patching Exchange 2016"},"content":{"rendered":"\n<p>We will start by setting the Hub Transport Service to Draining to stop it accepting any more messages.<\/p>\n\n\n\n<p><code>Set-ServerComponentState EXCH1 \u2013Component HubTransport \u2013State Draining \u2013Requester Maintenance<\/code><\/p>\n\n\n\n<p>Now we will redirect any queued messages to EXCH2.<\/p>\n\n\n\n<p><code>Redirect-Message -Server EXCH1 -Target EXCH2<\/code><\/p>\n\n\n\n<p>And suspend EXCH1 from the DAG.<\/p>\n\n\n\n<p><code>Suspend-ClusterNode \u2013Name EXCH1<\/code><\/p>\n\n\n\n<p>Next step is to disable Database Copy Auto Activation and initiate the move of any active databases on EXCH1 over to EXCH2.<\/p>\n\n\n\n<p><code>Set-MailboxServer EXCH1 \u2013DatabaseCopyActivationDisabledAndMoveNow $true<\/code><\/p>\n\n\n\n<p>We want to confirm that the DatabaseCopyAutoActivationPolicy setting is set to Unrestricted.<\/p>\n\n\n\n<p><code>Get-MailboxServer EXCH1 | Select DatabaseCopyAutoActivationPolicy<\/code><\/p>\n\n\n\n<p>And now set it to Blocked to prevent any of the Databases from becoming Active.<\/p>\n\n\n\n<p><code>Set-MailboxServer EXCH1 \u2013DatabaseCopyAutoActivationPolicy Blocked<\/code><\/p>\n\n\n\n<p>We will now check that all of the Active Databases on EXCH1 have moved to EXCH2.<\/p>\n\n\n\n<p><code>Get-MailboxDatabaseCopyStatus -Server EXCH1 | Where {$_.Status -eq \"Mounted\"}<\/code><\/p>\n\n\n\n<p>It may take a while for the Active databases to move, you can always log into the Exchange Admin Centre and manually move them if you are in a hurry.<\/p>\n\n\n\n<p>Once the Active databases have all been moved we will put EXCH1 into maintenance mode.<\/p>\n\n\n\n<p><code>Set-ServerComponentState EXCH1 \u2013Component ServerWideOffline \u2013State InActive \u2013Requester Maintenance<\/code><\/p>\n\n\n\n<p>At this point I usually like to reboot the server to free up resources and clear any pending reboot statuses.<\/p>\n\n\n\n<p>After the reboot, log back in and reopen the Exchange Management Shell as Administrator.<\/p>\n\n\n\n<p>Check the status of the PowerShell Execution Policy by running the following:<\/p>\n\n\n\n<p><code>get-executionpolicy \u2013list<\/code><\/p>\n\n\n\n<p>Ensure that the MachinePolicy and UserPolicy are set to Undefined (Refer to KB981474 to fix if they aren\u2019t).<\/p>\n\n\n\n<p>You are now free to install any required Windows Updates or apply the latest Exchange CU. Always review the accompanying ReadMe notes to ensure there will be no issues in your environment.<\/p>\n\n\n\n<p>After you have finished the updates and performed a reboot it is time to get things up and running again.<\/p>\n\n\n\n<p>Log back in and reopen the Exchange Management Shell as Administrator.<\/p>\n\n\n\n<p>Remove the server from Maintenance mode.<\/p>\n\n\n\n<p><code>Set-ServerComponentState EXCH1 \u2013Component ServerWideOffline \u2013State Active \u2013Requester Maintenance<\/code><\/p>\n\n\n\n<p>Resume the server in the DAG.<\/p>\n\n\n\n<p><code>Resume-ClusterNode \u2013Name EXCH1<\/code><\/p>\n\n\n\n<p>Reset the DatabaseCopyAutoActivationPolicy setting to Unrestricted.<\/p>\n\n\n\n<p><code>Set-MailboxServer EXCH1 \u2013DatabaseCopyAutoActivationPolicy Unrestricted<\/code><\/p>\n\n\n\n<p>Reset the DatabaseCopyActivationDisabledAndMoveNow setting.<\/p>\n\n\n\n<p><code>Set-MailboxServer EXCH1 \u2013DatabaseCopyActivationDisabledAndMoveNow $false<\/code><\/p>\n\n\n\n<p>Set the Hub Transport service to accept email messages.<\/p>\n\n\n\n<p><code>Set-ServerComponentState EXCH1 \u2013Component HubTransport \u2013State Active \u2013Requester Maintenance<\/code><\/p>\n\n\n\n<p>Log back into your Load Balancer and re-enable the virtual services for EXCH1 that you disabled previously.<\/p>\n\n\n\n<p>Now we will repeat the process for EXCH2.<\/p>\n\n\n\n<p>Log into your load balancer and set any virtual services you have for the DAG to drainstop and disable any connections to EXCH2 (Typically there would be SMTP and HTTPS virtual services). This will force any future connections to EXCH1.<\/p>\n\n\n\n<p>Log into EXCH2 and open the Exchange Management Shell as Administrator.<\/p>\n\n\n\n<p>We will start by setting the Hub Transport Service to Draining to stop it accepting any more messages.<\/p>\n\n\n\n<p><code>Set-ServerComponentState EXCH2 \u2013Component HubTransport \u2013State Draining \u2013Requester Maintenance<\/code><\/p>\n\n\n\n<p>Now we will redirect any queued messages to EXCH1.<\/p>\n\n\n\n<p><code>Redirect-Message -Server EXCH2 -Target EXCH1<\/code><\/p>\n\n\n\n<p>And suspend EXCH1 from the DAG.<\/p>\n\n\n\n<p><code>Suspend-ClusterNode \u2013Name EXCH2<\/code><\/p>\n\n\n\n<p>Next step is to disable Database Copy Auto Activation and initiate the move of any active databases on EXCH1 over to EXCH2.<\/p>\n\n\n\n<p><code>Set-MailboxServer EXCH2 \u2013DatabaseCopyActivationDisabledAndMoveNow $true<\/code><\/p>\n\n\n\n<p>We want to confirm that the DatabaseCopyAutoActivationPolicy setting is set to Unrestricted.<\/p>\n\n\n\n<p><code>Get-MailboxServer EXCH2 | Select DatabaseCopyAutoActivationPolicy<\/code><\/p>\n\n\n\n<p>And now set it to Blocked to prevent any of the Databases from becoming Active.<\/p>\n\n\n\n<p><code>Set-MailboxServer EXCH2 \u2013DatabaseCopyAutoActivationPolicy Blocked<\/code><\/p>\n\n\n\n<p>We will now check that all of the Active Databases on EXCH1 have moved to EXCH2.<\/p>\n\n\n\n<p><code>Get-MailboxDatabaseCopyStatus -Server EXCH2 | Where {$_.Status -eq \"Mounted\"}<\/code><\/p>\n\n\n\n<p>It may take a while for the Active databases to move, you can always log into the Exchange Admin Centre and manually move them if you are in a hurry.<\/p>\n\n\n\n<p>Once the Active databases have all been moved we will put EXCH2 into maintenance mode.<\/p>\n\n\n\n<p><code>Set-ServerComponentState EXCH2 \u2013Component ServerWideOffline \u2013State InActive \u2013Requester Maintenance<\/code><\/p>\n\n\n\n<p>At this point I usually like to reboot the server to free up resources and clear any pending reboot statuses.<\/p>\n\n\n\n<p>After the reboot, log back in and reopen the Exchange Management Shell as Administrator.<\/p>\n\n\n\n<p>Check the status of the PowerShell Execution Policy by running the following:<\/p>\n\n\n\n<p><code>get-executionpolicy \u2013list<\/code><\/p>\n\n\n\n<p>Ensure that the MachinePolicy and UserPolicy are set to Undefined (Refer to KB981474 to fix if they aren\u2019t).<\/p>\n\n\n\n<p>You are now free to install any required Windows Updates or apply the latest Exchange CU. Always review the accompanying ReadMe notes to ensure there will be no issues in your environment.<\/p>\n\n\n\n<p>After you have finished the updates and performed a reboot it is time to get things up and running again.<\/p>\n\n\n\n<p>Log back in and reopen the Exchange Management Shell as Administrator.<\/p>\n\n\n\n<p>Remove the server from Maintenance mode.<\/p>\n\n\n\n<p><code>Set-ServerComponentState EXCH2 \u2013Component ServerWideOffline \u2013State Active \u2013Requester Maintenance<\/code><\/p>\n\n\n\n<p>Resume the server in the DAG.<\/p>\n\n\n\n<p><code>Resume-ClusterNode \u2013Name EXCH2<\/code><\/p>\n\n\n\n<p>Reset the DatabaseCopyAutoActivationPolicy setting to Unrestricted.<\/p>\n\n\n\n<p><code>Set-MailboxServer EXCH2 \u2013DatabaseCopyAutoActivationPolicy Unrestricted<\/code><\/p>\n\n\n\n<p>Reset the DatabaseCopyActivationDisabledAndMoveNow setting.<\/p>\n\n\n\n<p><code>Set-MailboxServer EXCH2 \u2013DatabaseCopyActivationDisabledAndMoveNow $false<\/code><\/p>\n\n\n\n<p>Set the Hub Transport service to accept email messages.<\/p>\n\n\n\n<p><code>Set-ServerComponentState EXCH2 \u2013Component HubTransport \u2013State Active \u2013Requester Maintenance<\/code><\/p>\n\n\n\n<p>You can run some tests to ensure that everything has started up OK.<\/p>\n\n\n\n<p>Check that the cluster nodes have all come up OK.<\/p>\n\n\n\n<p><code>Get-ClusterNode<\/code><\/p>\n\n\n\n<p>Check that all of the required services are running OK.<\/p>\n\n\n\n<p><code>Test-ServiceHealth<\/code><\/p>\n\n\n\n<p>Test MAPI connectivity to each server that is hosting an active database.<\/p>\n\n\n\n<p><code>Test-MAPIConnectivity \u2013Server exch1<\/code><\/p>\n\n\n\n<p><code>Test-MAPIConnectivity \u2013Server exch2<\/code><\/p>\n\n\n\n<p>Check the DAG Copy Status Health.<\/p>\n\n\n\n<p><code>Get-MailboxDatabaseCopyStatus * | sort name | Select name,status,contentindexstate<\/code><\/p>\n\n\n\n<p>Check Replication Health.<\/p>\n\n\n\n<p><code>Get-DatabaseAvailabilityGroup | select -ExpandProperty:Servers | Test-ReplicationHealth<\/code><\/p>\n\n\n\n<p>Check the Database Activation Policy is set to Unrestricted.<\/p>\n\n\n\n<p><code>Get-MailboxServer EXCH1 | Select DatabaseCopyAutoActivationPolicy<\/code><\/p>\n\n\n\n<p><code>Get-MailboxServer EXCH2 | Select DatabaseCopyAutoActivationPolicy<\/code><\/p>\n\n\n\n<p>Check that the Server Component states are set to Active.<\/p>\n\n\n\n<p><code>(Get-ServerComponentState -Identity EXCH1 -Component ServerWideOffline).LocalStates<\/code><\/p>\n\n\n\n<p><code>(Get-ServerComponentState -Identity EXCH2 -Component ServerWideOffline).LocalStates<\/code><\/p>\n\n\n\n<p>From<\/p>\n\n\n\n<p><a href=\"http:\/\/www.hospitableit.com\/howto\/gracefully-patching-exchange-2016\/\">http:\/\/www.hospitableit.com\/howto\/gracefully-patching-exchange-2016\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"We will start by setting the Hub Transport Service to Draining to stop it accepting any more messages. Set-ServerComponentState EXCH1 \u2013Component HubTransport \u2013State Draining \u2013Requester Maintenance Now we will redirect any queued messages to EXCH2. Redirect-Message -Server EXCH1 -Target EXCH2 And suspend EXCH1 from the DAG. Suspend-ClusterNode \u2013Name EXCH1 Next step is to disable Database [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,83,3],"tags":[],"class_list":["post-228","post","type-post","status-publish","format-standard","hentry","category-exchange","category-patching","category-powershell"],"_links":{"self":[{"href":"http:\/\/www.thelamberts.com\/wiki\/wp-json\/wp\/v2\/posts\/228","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.thelamberts.com\/wiki\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.thelamberts.com\/wiki\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.thelamberts.com\/wiki\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.thelamberts.com\/wiki\/wp-json\/wp\/v2\/comments?post=228"}],"version-history":[{"count":1,"href":"http:\/\/www.thelamberts.com\/wiki\/wp-json\/wp\/v2\/posts\/228\/revisions"}],"predecessor-version":[{"id":229,"href":"http:\/\/www.thelamberts.com\/wiki\/wp-json\/wp\/v2\/posts\/228\/revisions\/229"}],"wp:attachment":[{"href":"http:\/\/www.thelamberts.com\/wiki\/wp-json\/wp\/v2\/media?parent=228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.thelamberts.com\/wiki\/wp-json\/wp\/v2\/categories?post=228"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.thelamberts.com\/wiki\/wp-json\/wp\/v2\/tags?post=228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}