These powershell scripts will put your server or group of servers in Full Maintenance Mode or (Offline Maintenance Mode).

They will put the Server, the Health Service on that server and the Health Service Watcher into maintenance mode. (Essentially all objects related to a server)

Usage for Groups (All one Line)

GroupMaintenanceMode.ps1rootMS: ‘’ -groupName: ‘_AU 3AM Sunday Reboot’ –numberOfHoursInMaintenanceMode:4 -comment:’_AU 3AM Sunday Reboot MaintenanceMode

Usage for Individual Servers (All one Line)

AgentMaintenanceMode.ps1 –rootMS: ‘’ -computerPrincipalName: ‘’ -numberOfHoursInMaintenanceMode:4 -comment:’ MaintenanceMode’

These scripts are just modified versions of the great powershell scripts created by Boris yanushpolsky.



2 Responses

  1. Is there a way to do a powershell script that would automatically place a server into full maintenance mode if the Root Management Server received an alert that the server was sent a shutdown command?

    So what I want is to have a server generate an alert when an administrator sends it a shutdown command. I setup a monitor to alert when event id 1074 by USER32 is generated in the system event viewer. But once the Root Management Server gets that alert, I want it to place that agent/heathservice/server into maintenance mode.

    If I created a powershell script on the RMS that was setup as a recovery in the alert was what I was thinking, but could the server shutdown too fast to get the recovery to go?

    And what would the script look like would be my other question.

Leave a Reply

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