Book Image

Microsoft Exchange Server Powershell Cookbook (Update)

Book Image

Microsoft Exchange Server Powershell Cookbook (Update)

Overview of this book

Table of Contents (21 chapters)
Microsoft Exchange Server PowerShell Cookbook Third Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Performing maintenance on Database Availability Group members


When it comes to performing maintenance on servers that are part of a DAG, you'll need to move any active databases off to another member in the DAG. This will allow you to install patches or take the server down for hardware repairs or upgrades, without affecting database availability. This recipe will show you how to use some of the built-in PowerShell scripts installed by Exchange 2013 that can be used to place a server in and out of the maintenance mode.

How to do it...

Let's see how to perform maintenance on a DAG using the following steps:

  1. First, switch to the $exscripts directory:

    Set-Location $exscripts
    
  2. Next, run the StartDagServerMaintenance.ps1 script and specify the server name that should be put into maintenance mode:

    .\StartDagServerMaintenance.ps1 -ServerName MBX1
    

How it works...

When you run the StartDagMaintenance.ps1 script, it moves all the active databases that are running on the specified server to other members...