Exchange Server into Maintenance Mode Part-1

Today we are Discussing about Exchange Server Maintenance

Lab Setup

Exchange Server 1: DC-EXCH-19

Exchange Server 2: DC-EXCH-02

No: of Database: 2

Both Database Mounted on DC-EXCH-02

Server to be placed in Maintenance Mode: DC-EXCH-02

Step 1 – Confirm Replication / Server Health

Open Exchange Management Shell and Issue the following commands in the Exchange Management Shell, and confirm that all tests have passed.

Test-ReplicationHealth -Server DC-EXCH-19

Test-ReplicationHealth -Server DC-EXCH-02

If any errors are displayed, resolve them before proceeding.

Step 2 – Confirm the Database Copy Status

Run these two commands.

Get-MailboxDatabaseCopyStatus -Server DC-EXCH-19

Get-MailboxDatabaseCopyStatus -Server DC-EXCH-02

Confirm that the Status of each database is either “Mounted” or “Healthy”. Confirm that the CopyQueueLength and ReplayQueueLength is a small number, like less than 10. Confirm the ContentIndexState is “Healthy” for all databases.

Step 3 – Move the Databases

Log in to the Exchange Admin Center.

Under “servers”, on the “databases” tab, select the first database that is mounted on DC-EXCH-02. On the right-hand side, click “Activate” to activate it on DC-EXCH-19.

Step 4 – Disable the Server on the Load Balancers

Log in to your Load Balancers. Disable DC-EXCH-02 on the Load Balancers, so no more user traffic is sent to DC-EXCH-02.

Step 5 – Drain the Mail Queues

Use this command

Set-ServerComponentState DC-EXCH-02 -Component HubTransport -State Draining -Requester Maintenance

Confirm that Queues are empty

Get-Queue –Server DC-EXCH-02 | ? {$_.Identity -notmatch “Poison” -AND $_.Identity -notmatch “Shadow”}

Step 6 – Disable Database Activation

Since you’ve already manually moved all databases off from DC-EXCH-02, the commands below mark the server as disabled for database activation.

Set-MailboxServer DC-EXCH-02 -DatabaseCopyActivationDisabledAndMoveNow $True

Set-MailboxServer DC-EXCH-02 -DatabaseCopyAutoActivationPolicy Blocked

Step 7 – Server Wide Disable

The final step is to mark all Exchange services as inactive.

Set-ServerComponentState DC-EXCH-02 -Component ServerWideOffline -State Inactive -Requester Maintenance

Step 8 – Verifying the Maintenance Server

Get-databaseavailabilitygroup -status | fl name,ServersInMaintenance

You’re now free to patch and reboot DC-EXCH-02, or whatever else needs to get done on this server.

Now we have successfully taken Exchange server into Maintenance mode and after finishing our Maintenance its mandatory to take out the server from maintenance mode and place it back into production.That we can see in our Part-2

Thank You…

Leave a Reply