Ying Li(MVP) at myITforum.com

PowerShell & System Center

PowerShell script to schedule a maintenance window in SCOM 2007

In SCOM 2007, at times you will need to place  a server (servers) in maintenance mode to prevent getting unnecessary alerts.

Here is how you can do it using New-MaintenanceWindow cmdlet:

$strServer  = Get-Agent | Where-object {$_.Name – match “FWS”}

$strServer.HostComputer |New-MaintenanceWindow `

-StartTime (Get-Date) `

-EndTime (Get-Date).AddMinutes (60) `

-Comment “Windows Server 2003 Service Pack 1”

Comments

jgoodson said:

The script worked great. Can you expand it to set maintenance within Health Service and Health Service Watcher per KB 942866 to cut out Heartbeat Notifications?

# February 12, 2008 4:06 PM

PowerShell script to put the Server, the Health Service and the Health Service Watcher on that server into maintenance mode - Ying Li at myITforum.com said:

Pingback from  PowerShell script to put the Server, the Health Service and the Health Service Watcher on that server into maintenance mode - Ying Li at myITforum.com

# April 6, 2008 9:42 PM