Maintenance Mode

Rising Flight 6,096 Reputation points
2025-12-12T12:52:34.1533333+00:00

Hi All,

I am using Exchange Server SE Edition(Hybrid).

I have two VMs — EXCH01 and EXCH02 — in a DAG. EXCH01 hosts DB1, and EXCH02 hosts DB2. My email flow is quite heavy with a lot of internal relay. I want to reboot the EXCH01 VM. If I follow the steps below to put EXCH01 into maintenance mode, will I lose any emails?

Set-ServerComponentState "exch01.contoso.com" -Component HubTransport -State Draining -Requester Maintenance

Restart-Service MSExchangeTransport
Restart-Service MSExchangeFrontEndTransport

Redirect-Message -Server "exch01.contoso.com" -Target "exch02.contoso.com"

Suspend-ClusterNode "exch01.contoso.com"

Set-MailboxServer "exch01.contoso.com" -DatabaseCopyActivationDisabledAndMoveNow $True

Set-MailboxServer "exch01.contoso.com" -DatabaseCopyAutoActivationPolicy Blocked

Set-ServerComponentState "exch01.contoso.com" -Component ServerWideOffline -State Inactive -Requester Maintenance

Exchange | Exchange Server | Management
Exchange | Exchange Server | Management
The administration and maintenance of Microsoft Exchange Server to ensure secure, reliable, and efficient email and collaboration services across an organization.
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-12-12T12:52:47.4066667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    When you follow the steps to put EXCH01 into maintenance mode as outlined, you should not lose any emails. The commands you listed are designed to ensure that email flow is managed properly during the maintenance process. Here’s a brief overview of what each step does:

    1. Set-ServerComponentState: This command puts the Hub Transport component into a draining state, which allows existing messages to be processed while preventing new messages from being routed to EXCH01.
    2. Restart-Service: Restarting the transport services helps to ensure that any pending messages are processed correctly.
    3. Redirect-Message: This command redirects messages pending delivery to EXCH02, ensuring that emails continue to flow even while EXCH01 is in maintenance mode.
    4. Suspend-ClusterNode: This prevents EXCH01 from becoming the Primary Active Manager (PAM) during maintenance.
    5. Set-MailboxServer: These commands disable database activation and block auto-activation, ensuring no databases are active on EXCH01.
    6. Set-ServerComponentState: Finally, this command puts the server into maintenance mode.

    By following these steps, you effectively manage the email flow and minimize the risk of losing emails during the maintenance of EXCH01. However, it is always a good practice to monitor the email flow and ensure that all processes are functioning as expected before and after the maintenance.


    References:

    0 comments No comments

  2. Kudos-Ng 10,630 Reputation points Microsoft External Staff Moderator
    2025-12-12T14:16:20.3+00:00

    Hi Rising Flight,

    Thank you for posting your question in the Microsoft Q&A forum. 

    Regarding your ask about whether the maintenance script will avoid losing emails, I reviewed the references and the QA Assist notes and would summarize the key insights as follows:

    • Your script closely aligns with Microsoft guidance that the QA Assist cited, and also mirrors common community runbooks. However, it appears to match most closely an older Microsoft article aimed at Exchange Server 2013. While the steps and cmdlets are still technically valid, that article is dated.
    • To be fully confident and current, you should follow Microsoft’s newer, consolidated guidance for maintaining a DAG member: https://dori-uw-1.kuma-moon.com/en-us/exchange/high-availability/manage-ha/manage-dags#performing-maintenance-on-dag-members This page is the official recommendation covering modern versions (Exchange 2016/2019 and Exchange Subscription Edition) and reflects today’s best practices. Microsoft provides detailed notes and step‑by‑step instructions in that article, and because it’s the official recommendation, the procedure is designed to safeguard database integrity and prioritize data protection during maintenance (including moving active databases off the server and preventing them from moving back while you complete the work).

    I hope the insight above is helpful.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.