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://learn.microsoft.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.