You want to create mailboxes in Exchange Online and use Office 365. Before you can…
Take Exchange Server out of maintenance mode
Suppose you have put the Exchange Server in maintenance mode and finished working on it. You like to take the Exchange Server out of maintenance mode. It’s good to have the Exchange Server back in production. Run the commands and verify if all is working as expected on the Exchange Server.
Table of contents
Take Exchange Server out of maintenance mode
After the update, we like to get the Exchange Server EX01 to be active again. Run Exchange Management Shell as administrator.
You can now remove the server from maintenance mode. Note: If the server is not a DAG member, only the first and last commands are necessary. If the server is a DAG member, you need to run all the commands. Use the database copy auto-activation policy value that was set on the server. The default is Unrestricted.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
[PS] C:\>Set-ServerComponentState EX01 -Component ServerWideOffline -State Active -Requester Maintenance [PS] C:\>Resume-ClusterNode -Name EX01 Name ID State ---- -- ----- EX01 1 Up [PS] C:\>Set-MailboxServer EX01 -DatabaseCopyAutoActivationPolicy Unrestricted [PS] C:\>Set-MailboxServer EX01 -DatabaseCopyActivationDisabledAndMoveNow $false [PS] C:\>Set-ServerComponentState EX01 -Component HubTransport -State Active -Requester Maintenance |
Rebalance Database Availability Groups
Throughout the update process, the database copies will move between DAG members. Return your active database copies to their most preferred DAG member. Use the PowerShell script supplied by Microsoft.
1 2 3 |
[PS] C:\>cd $exscripts [PS] C:\Program Files\Microsoft\Exchange Server\V15\scripts\>.\RedistributeActiveDatabases.ps1 -DagName DAG1 -BalanceDbsByActivationPreference -SkipMoveSuppressionChecks |
Verify out of maintenance mode
Verify if the Exchange Server EX01 is back up and running. Run the following commands.
The cluster node needs to have the state up.
1 2 3 4 5 |
[PS] C:\>Get-ClusterNode EX01 Name ID State ---- -- ----- EX01 1 Up |
Check that the cluster node has the state up on all the Exchange Servers.
1 |
[PS] C:\>Get-ClusterNode |
Check that all the required services are running.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
[PS] C:\>Test-ServiceHealth EX01 Role : Mailbox Server Role RequiredServicesRunning : True ServicesRunning : {IISAdmin, MSExchangeADTopology, MSExchangeDelivery, MSExchangeIS, MSExchangeMailboxAssistants, MSExchangeRepl, MSExchangeRPC, MSExchangeServiceHost, MSExchangeSubmission, MSExchangeThrottling, MSExchangeTransportLogSearch, W3Svc, WinRM} ServicesNotRunning : {} Role : Client Access Server Role RequiredServicesRunning : True ServicesRunning : {IISAdmin, MSExchangeADTopology, MSExchangeMailboxReplication, MSExchangeRPC, MSExchangeServiceHost, W3Svc, WinRM} ServicesNotRunning : {} Role : Unified Messaging Server Role RequiredServicesRunning : True ServicesRunning : {IISAdmin, MSExchangeADTopology, MSExchangeServiceHost, MSExchangeUM, W3Svc, WinRM} ServicesNotRunning : {} Role : Hub Transport Server Role RequiredServicesRunning : True ServicesRunning : {IISAdmin, MSExchangeADTopology, MSExchangeEdgeSync, MSExchangeServiceHost, MSExchangeTransport, MSExchangeTransportLogSearch, W3Svc, WinRM} ServicesNotRunning : {} |
Test the MAPI Connectivity.
1 2 3 4 5 6 7 8 9 |
[PS] C:\>Test-MAPIConnectivity -Server EX01 MailboxServer Database Result Error ------------- -------- ------ ----- EX01 DB1 Success EX01 DB2 Success EX01 DB3 Success EX01 DB4 Success EX01 DB5 Success |
Test the MAPI Connectivity on all the Exchange Servers.
1 |
[PS] C:\>Get-MailboxDatabase | Test-MAPIConnectivity |
Get the result of the DAG Copy Status Health.
1 2 3 4 5 6 7 8 9 |
[PS] C:\>Get-MailboxDatabaseCopyStatus -Server EX01 | Sort Name | Select Name, Status, Contentindexstate Name Status ContentIndexState ---- ------ ----------------- DB1\EX01 Mounted Healthy DB2\EX02 Mounted Healthy DB3\EX01 Mounted Healthy DB4\EX02 Mounted Healthy DB5\EX01 Mounted Healthy |
Get the result of the DAG Copy Status Health on all the Exchange Servers.
1 |
[PS] C:\>Get-MailboxDatabaseCopyStatus * | Sort Name | Select Name, Status, Contentindexstate |
Check the Replication Health.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
[PS] C:\>Test-ReplicationHealth -Server EX01 Server Check Result Error ------ ----- ------ ----- EX01 ClusterService Passed EX01 ReplayService Passed EX01 ActiveManager Passed EX01 TasksRpcListener Passed EX01 TcpListener Passed EX01 ServerLocatorService Passed EX01 DagMembersUp Passed EX01 MonitoringService Passed EX01 ClusterNetwork Passed EX01 QuorumGroup Passed EX01 FileShareQuorum Passed EX01 DatabaseRedundancy Passed EX01 DatabaseAvailability Passed EX01 ClusterService Passed EX01 ReplayService Passed EX01 ActiveManager Passed EX01 TasksRpcListener Passed EX01 TcpListener Passed EX01 ServerLocatorService Passed EX01 DagMembersUp Passed EX01 MonitoringService Passed EX01 ClusterNetwork Passed EX01 QuorumGroup Passed EX01 FileShareQuorum Passed EX01 DatabaseRedundancy Passed EX01 DatabaseAvailability Passed EX01 DBCopySuspended Passed EX01 DBCopyFailed Passed EX01 DBInitializing Passed EX01 DBDisconnected Passed EX01 DBLogCopyKeepingUp Passed EX01 DBLogReplayKeepingUp Passed |
Check the Replication Health on all the Exchange Servers.
1 |
[PS] C:\>Get-DatabaseAvailabilityGroup | Select -ExpandProperty:Servers | Test-ReplicationHealth | Sort Name |
Verify the Database Activation Policy is set to Unrestricted.
1 2 3 4 5 |
[PS] C:\>Get-MailboxServer EX01 | Select Name, DatabaseCopyAutoActivationPolicy Name DatabaseCopyAutoActivationPolicy ---- -------------------------------- EX01 Unrestricted |
Verify the Database Activation Policy is set to Unrestricted on all the Exchange Servers.
1 |
[PS] C:\>Get-MailboxServer | Select Name, DatabaseCopyAutoActivationPolicy |
Load balancer
Do you have the Exchange Server configured in a load balancer? Verify that the load balancer health checks have taken the server in the pool or marked it as online/active. If the load balancer does not automatically do this, manually mark the server as online/active. Log into your load balancer and set any virtual services you have to enable any connections to Server EX01. Typically there would be SMTP and HTTPS virtual services. This will enable connections to Server EX01.
Conclusion
In this article, you learned how to take the Exchange Server out of maintenance mode. It’s important to run the commands and check if all the services are healthy. It’s good to have a list of PowerShell commands before starting. The output needs to be positive.
Did you enjoy this article? You may like Pagefile Exchange 2013/2016 best practice PowerShell. Don’t forget to follow us and share this article.
This Post Has 0 Comments