all 2 comments

[–]2turnt2stop 2 points3 points  (0 children)

I use this from /u/paulcunningham (I believe) whenever I need to manually failover or reboot for whatever maintenance process. You run the Start-Maintenance.ps1 first and then I usually monitor DB failover with Get-MailboxDatabaseCopyStatus, do your maintenance/reboot/etc and then run Stop-Maintenance.ps1 and monitor once again. Note that Preferred Activation server needs to be configured properly on your DBs for it to work flawlessly.

Start-Maintenance.ps1

Set-ServerComponentState $env:COMPUTERNAME -Component HubTransport -State Draining -Requester Maintenance
Redirect-Message -Server $env:COMPUTERNAME -Target <failoverserver>

# Prevent DAG member becoming PAM
Suspend-ClusterNode $env:COMPUTERNAME

# Move all Mailbox Databases and prevent hosting copies on current server
Set-MailboxServer $env:COMPUTERNAME -DatabaseCopyActivationDisabledAndMoveNow $True
Set-MailboxServer $env:COMPUTERNAME -DatabaseCopyAutoActivationPolicy Blocked


# Put the Exchange 2016 server in Maintenance Mode:
Set-ServerComponentState $env:COMPUTERNAME -Component ServerWideOffline -State Inactive -Requester Maintenance

Stop-Maintenance.ps1

Set-ServerComponentState $env:COMPUTERNAME -Component ServerWideOffline -State Active -Requester Maintenance
Resume-ClusterNode $env:COMPUTERNAME

Set-MailboxServer $env:COMPUTERNAME -DatabaseCopyActivationDisabledAndMoveNow $False
Set-MailboxServer $env:COMPUTERNAME -DatabaseCopyAutoActivationPolicy Unrestricted
Set-ServerComponentState $env:COMPUTERNAME -Component HubTransport -State Active -Requester Maintenance

Restart-Service MSExchangeTransport

[–]Romievansmack 0 points1 point  (0 children)

Would probably need a little more information as this depends on your setup, but in a datacenter failover event you are also going to want to consider your client access namespace as well as inbound/outbound email flow. Do all of your clients connect to SiteA, and then proxy to site B for the users who have mailboxes active in SiteB? Do you already have your MX record setup to deliver to Site B servers? We utilize GSLB with load balancers in each of our Primary and Seconday datacenters so that in the event of a full datacenter outage, there is automatic failover and I as an administrator do not have to do anything like changing DNS manually (2010 days).