Let&#8217;s assume that we have ex01.itforce.local and ex02.itforce.local Exchange 2016 servers in DAG cluster. We need to install new CU on this cluster without downtime. (assumed that all CAS, smtp protocols are properly loadbalanced). So we need: at first disable all workloads/switch to maintenance mode on the node ex01, install CU on ex01, reboot ex01 exit from maintenance mode on ex01 enter into maintenance mode on ex02 install CU on ex02, reboot ex02 exit from maintenance mode on ex02 equally spread workload on both nodes  <span><a href="https://www.itforce.mn/index.php/2020/03/28/how-properly-enter-into-maintenance-mode-on-exchange2016-2013-dag/" class="readmore">Continue reading &rarr;</a></span>{"id":1515,"date":"2020-03-28T18:57:08","date_gmt":"2020-03-28T10:57:08","guid":{"rendered":"https:\/\/www.itforce.mn\/?p=1515"},"modified":"2021-04-16T22:27:21","modified_gmt":"2021-04-16T14:27:21","slug":"how-properly-enter-into-maintenance-mode-on-exchange2016-2013-dag","status":"publish","type":"post","link":"https:\/\/www.itforce.mn\/index.php\/2020\/03\/28\/how-properly-enter-into-maintenance-mode-on-exchange2016-2013-dag\/","title":{"rendered":"how properly enter into maintenance mode on Exchange2016\/2013 DAG"},"content":{"rendered":"<p>Let&#8217;s assume that we have<\/p>\n<p>ex01.itforce.local and ex02.itforce.local Exchange 2016 servers in DAG cluster. We need to install new CU on this cluster without downtime. (assumed that all CAS, smtp protocols are properly loadbalanced). So we need:<\/p>\n<ol>\n<li>at first disable all workloads\/switch to maintenance mode on the node ex01,<\/li>\n<li>install CU on ex01,<\/li>\n<li>reboot ex01<\/li>\n<li>exit from maintenance mode on ex01<\/li>\n<li>enter into maintenance mode on ex02<\/li>\n<li>install CU on ex02,<\/li>\n<li>reboot ex02<\/li>\n<li>exit from maintenance mode on ex02<\/li>\n<li>equally spread workload on both nodes again<\/li>\n<\/ol>\n<pre>#goto ex01\r\n#run in elevated mode powershell for exchange\r\n\r\n#prepare smtp transport:\r\nSet-ServerComponentState ex01 -Component HubTransport -State Draining -Requester Maintenance\r\nRestart-Service MSExchangeTransport\r\nRedirect-Message -Server ex01 -Target ex02.itforce.local\r\n\r\n#to check:\r\nGet-ServerComponentState -Identity ex01.itforce.local\r\nGet-ServerComponentState ex01 -Component HubTransport\r\n\r\n#prepare cluster:\r\nGet-DatabaseAvailabilityGroup -Status | fl Name,PrimaryActiveManager\r\nMove-ClusterGroup \"cluster group\" -Node ex02\r\nSuspend-ClusterNode ex01\r\nGet-ClusterNode\r\nGet-DatabaseAvailabilityGroup -Status | fl Name,PrimaryActiveManager\r\n\r\n#prepare mailboxes:\r\nGet-MailboxDatabaseCopyStatus -Server ex01\r\nGet-MailboxDatabaseCopyStatus -Server ex01 | ? {$_.Status -eq \"Mounted\"} | % {Move-ActiveMailboxDatabase $_.DatabaseName -ActivateOnServer ex02 -Confirm:$false}\r\nGet-MailboxDatabaseCopyStatus -Server ex02\r\nSet-MailboxServer EX01 -DatabaseCopyAutoActivationPolicy Blocked\r\nGet-MailboxServer EX01 | ft Name,DatabaseCopyAutoActivationPolicy\r\n\r\n#finally switch to maintenance mode ex01:\r\nSet-ServerComponentState EX01 -Component ServerWideOffline -State Inactive -Requester Maintenance\r\nGet-ServerComponentState EX01 -Component ServerWideOffline\r\n<\/pre>\n<p>#exit from maintenance on ex01:<\/p>\n<pre>Set-ServerComponentState EX01 -Component ServerWideOffline -State Active -Requester Maintenance\r\nGet-ServerComponentState EX01 -Component ServerWideOffline\r\n\r\n#enable cluster node:\r\nResume-ClusterNode EX01\r\nGet-ClusterNode\r\n\r\n#enable copy:\r\nSet-MailboxServer EX01 -DatabaseCopyAutoActivationPolicy Unrestricted\r\n\r\n#enable transports\r\nSet-ServerComponentState EX01 -Component HubTransport -State Active -Requester Maintenance\r\nRestart-Service MSExchangeTransport\r\nGet-ServerComponentState EX01 -Component HubTransport\r\nGet-ServerComponentState EX02 | ft Component,State -AutoSize\r\n\r\n#Option1 - move all copy to ex01:\r\nGet-MailboxDatabaseCopyStatus -Server ex02 | ? {$_.Status -eq \"Mounted\"} | % {Move-ActiveMailboxDatabase $_.DatabaseName -ActivateOnServer ex01 -Confirm:$false}\r\n#Option2 - just loadbalance\r\ncd \"C:\\Program Files\\Microsoft\\Exchange Server\\V15\\scripts\"\r\n.\\RedistributeActiveDatabases.ps1 -DagName DAG4exchange -BalanceActivationPreferences\r\n.\\RedistributeActiveDatabases.ps1 -BalanceDbsByActivationPreference -Confirm:$false\r\n<\/pre>\n<p>#The same steps on ex02:<br \/>\n#goto ex02<br \/>\n#run in elevated mode powershell for exchange<\/p>\n<pre>#prepare smtp transport:\r\nSet-ServerComponentState ex02 -Component HubTransport -State Draining -Requester Maintenance\r\nRestart-Service MSExchangeTransport\r\nRedirect-Message -Server ex02 -Target ex01.itforce.local\r\nGet-ServerComponentState -Identity ex02.itforce.local\r\nGet-ServerComponentState ex02 -Component HubTransport\r\n\r\n#prepare cluster:\r\nGet-DatabaseAvailabilityGroup -Status | fl Name,PrimaryActiveManager\r\nMove-ClusterGroup \"cluster group\" -Node ex01\r\nSuspend-ClusterNode ex02\r\nGet-ClusterNode\r\nGet-DatabaseAvailabilityGroup -Status | fl Name,PrimaryActiveManager\r\n\r\n#prepare mailboxes:\r\nGet-MailboxDatabaseCopyStatus -Server ex02\r\nGet-MailboxDatabaseCopyStatus -Server ex02 | ? {$_.Status -eq \"Mounted\"} | % {Move-ActiveMailboxDatabase $_.DatabaseName -ActivateOnServer ex01 -Confirm:$false}\r\nGet-MailboxDatabaseCopyStatus -Server ex01\r\nSet-MailboxServer EX02 -DatabaseCopyAutoActivationPolicy Blocked\r\nGet-MailboxServer EX02 | ft Name,DatabaseCopyAutoActivationPolicy\r\n\r\n#finally switch to maintenance mode ex02:\r\nSet-ServerComponentState EX02 -Component ServerWideOffline -State Inactive -Requester Maintenance\r\nGet-ServerComponentState EX02 -Component ServerWideOffline\r\n\r\n<\/pre>\n<p>#exit from maintenance on ex02:<\/p>\n<pre>\r\nSet-ServerComponentState EX02 -Component ServerWideOffline -State Active -Requester Maintenance\r\nGet-ServerComponentState EX02 -Component ServerWideOffline\r\n\r\n#enable cluster node:\r\nResume-ClusterNode EX02\r\nGet-ClusterNode\r\n\r\n#enable copy:\r\nSet-MailboxServer EX02 -DatabaseCopyAutoActivationPolicy Unrestricted\r\n\r\n#enable transports\r\nSet-ServerComponentState EX02 -Component HubTransport -State Active -Requester Maintenance\r\nRestart-Service MSExchangeTransport\r\nGet-ServerComponentState EX02 -Component HubTransport\r\nGet-ServerComponentState EX01 | ft Component,State -AutoSize\r\n\r\n\r\n#Option1 - move all copy to ex02 (optional):\r\nGet-MailboxDatabaseCopyStatus -Server ex01 | ? {$_.Status -eq \"Mounted\"} | % {Move-ActiveMailboxDatabase $_.DatabaseName -ActivateOnServer ex02 -Confirm:$false}\r\n\r\n#Option2 - re-loadbalance workload:\r\ncd \"C:\\Program Files\\Microsoft\\Exchange Server\\V15\\scripts\"\r\n.\\RedistributeActiveDatabases.ps1 -DagName DAG4exchange -BalanceActivationPreferences\r\n.\\RedistributeActiveDatabases.ps1 -BalanceDbsByActivationPreference -Confirm:$false\r\n<\/pre>\n<p>Except bottom re-balancing builtin Exchange scripts all other rows can be copy pasted into Exchange management console.<\/p>\n","protected":false},"excerpt":{"rendered":null,"protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,17],"tags":[],"class_list":["post-1515","post","type-post","status-publish","format-standard","hentry","category-exchange-server","category-powershell-tips"],"_links":{"self":[{"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/posts\/1515","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/comments?post=1515"}],"version-history":[{"count":8,"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/posts\/1515\/revisions"}],"predecessor-version":[{"id":1592,"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/posts\/1515\/revisions\/1592"}],"wp:attachment":[{"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/media?parent=1515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/categories?post=1515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/tags?post=1515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}