skip to Main Content

Server switchover Exchange 2016 PowerShell

Perform a server switchover in Exchange 2016 through PowerShell. Why do you need to perform a server switchover? For example, you want to update your Exchange Server. First, move the mounted databases to another Exchange Server. After you moved the databases, update and reboot the Exchange Server. In this guide, you will learn how to perform a server switchover in Exchange 2016. You will perform the server switchover through Exchange Management Shell (EMC). Have a read on my previous article if you want to perform a server switchover Exchange 2016 through EAC.

Prepare information

First, let’s list the Exchange Servers in the organization. Run Exchange Management Shell as administrator. Run the following command.

[PS] C:\>Get-ExchangeServer | Format-Table Name, Serverrole, Edition, AdminDisplayVersion

Name ServerRole    Edition AdminDisplayVersion
---- ----------    ------- -------------------
EX01    Mailbox Enterprise Version 15.1 (Build 1847.3)
EX02    Mailbox Enterprise Version 15.1 (Build 1847.3)

We have two Exchange Server 2016 in the organization.

Second, let’s list the databases. We can see on which Exchange Server the databases are mount. We are going to sort on Server Name.

[PS] C:\>Get-MailboxDatabase -Status | Sort Server | Format-Table Name, Server, Mounted

Name      Server Mounted
----      ------ -------
DB15-2016 EX01      True
DB4-2016  EX01      True
DB17-2016 EX01      True
DB16-2016 EX01      True
DB20-2016 EX01      True
DB1-2016  EX01      True
DB3-2016  EX01      True
DB9-2016  EX01      True
DB6-2016  EX01      True
DB14-2016 EX02      True
DB13-2016 EX02      True
DB12-2016 EX02      True

Three databases are mount on the Exchange Server 2016 EX02.

We want to list the databases only on a particular Exchange Server. We are going to sort on Database Name.

[PS] C:\>Get-MailboxDatabase -Status | ? {$_.server -like "EX02"} | Sort Name | Format-Table Name, Server, Mounted

Name      Server Mounted
----      ------ -------
DB12-2016 EX02      True
DB13-2016 EX02      True
DB14-2016 EX02      True

Correct output. Three databases are on the Exchange Server EX02. Now that you know which Exchange Servers are in the organization. You can proceed further to perform a server switchover.

Server switchover Exchange 2016 through PowerShell

We want to move all the databases from Exchange Server EX02 to Exchange Server EX01.

[PS] C:\>Move-ActiveMailboxDatabase -Server "EX01" -ActivateOnServer "EX02"

Identity ActivateServerAtStart ActivateServerAtEnd Status    NumberOfLogsLost RecoveryPointObjective MountStatusAtMoveStart MountStatusAtMoveEnd
-------- --------------------- ------------------- ------    ---------------- ---------------------- ---------------------- --------------------
DB12-2016 EX02                  EX01               Succeeded 0                2-2-2020 18:10:09      Mounted                Mounted
DB13-2016 EX02                  EX01               Succeeded 0                2-2-2020 18:10:09      Mounted                Mounted
DB14-2016 EX02                  EX01               Succeeded 0                2-2-2020 18:10:09      Mounted                Mounted

Verify server switchover Exchange 2016

After the switchover, we like to verify if the move went great.

[PS] C:\>Get-MailboxDatabase -Status | Sort Server | Format-Table Name, Server, Mounted

Name      Server Mounted
----      ------ -------
DB14-2016 EX01      True
DB13-2016 EX01      True
DB12-2016 EX01      True
DB17-2016 EX01      True
DB16-2016 EX01      True
DB15-2016 EX01      True
DB6-2016  EX01      True
DB1-2016  EX01      True
DB3-2016  EX01      True
DB4-2016  EX01      True
DB20-2016 EX01      True
DB9-2016  EX01      True

All the databases are active on the Exchange Server EX01.

Conclusion

You learned how to perform a server switchover in Exchange 2016 through PowerShell. Prepare before you start the switchover. I hope this article was informative to you. If you enjoyed this article, you may like Pagefile Exchange 2013/2016 best practice. Don’t forget to follow us and share this article.

ALI TAJRAN

ALI TAJRAN

ALI TAJRAN is a passionate IT Architect, IT Consultant, and Microsoft Certified Trainer. He started Information Technology at a very young age, and his goal is to teach and inspire others. Read more »

This Post Has 0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top