Check Mirror and Witness Status Before Rebooting

The following script, meant to run as part of a pre-check for automated reboots, will check that all mirrored databases are in a Synchronized status and the witness is in a Connected status.  If the above conditions are true, the script returns a 0 exit code, otherwise, it returns < 0.

See http://msdn.microsoft.com/en-us/library/ms189902.aspx for more on mirroring quorum.

Leave a Reply

Your email address will not be published. Required fields are marked *