24/7/365 Support

Schedule a Maintenance Window

Problem

You want to place a server in maintenance mode to prevent it from generating incorrect alerts.

Solution

To schedule a maintenance window on a computer, use the NewMaintenanceWindow cmdlet:

$computer = GetAgent | WhereObject { $_.Name match "Denver" }

$computer.HostComputer | NewMaintenanceWindow `

StartTime (GetDate) `

EndTime (GetDate).AddMinutes(5) `

Comment "Security updates"

To retrieve information about that maintenance window, use the GetMaintenanceWindow cmdlet:

>$computer.HostComputer | GetMaintenanceWindow

MonitoringObjectId : a542ffe891a284a637b00555b15513bd

StartTime : 5/22/2007 9:27:23 AM

ScheduledEndTime : 5/22/2007 9:32:23 AM

EndTime :

Reason : PlannedOther

Comments : Security updates

User : CONTOSO\Administrator

LastModified : 5/22/2007 9:27:23 AM

ManagementGroup : MMS

ManagementGroupId : 846c09747fd058f28020400f125beb67

To stop maintenance mode, use the SetMaintenanceWindow cmdlet to end the maintenance window immediately:

$computer.HostComputer | SetMaintenanceWindow EndTime (GetDate)

Discussion

For more information about the NewMaintenanceWindow cmdlet, type GetHelp NewMaintenanceWindow. For more information about the GetMaintenanceWindow cmdlet, type GetHelp GetMaintenanceWindow. For more information about the SetMaintenanceWindow cmdlet, type GetHelp SetMaintenanceWindow.

Help Category:

Get Windows Dedicated Server

Only reading will not help you, you have to practice it! So get it now.

Processor RAM Storage Server Detail
Intel Atom C2350 1.7 GHz 2c/2t 4 GB DDR3 1× 1 TB (HDD SATA) Configure Server
Intel Atom C2350 1.7 GHz 2c/2t 4 GB DDR3 1× 128 GB (SSD SATA) Configure Server
Intel Atom C2750 2.4 GHz 8c/8t 8 GB DDR3 1× 1 TB (HDD SATA) Configure Server
Intel Xeon E3-1230 v2 3.3 GHz 4c/8t 16 GB DDR3 1× 256 GB (SSD SATA) Configure Server
Intel Atom C2350 1.7 GHz 2c/2t 4 GB DDR3 1× 250 GB (SSD SATA) Configure Server

What Our Clients Say