Maintenance Window

Question

We currently use maintenance windows for our server patching. we have about 20 collection that we have to modify the MW on each month for the 2 weeks after patch tuesday. i was curious if anyone is using a script to change theirs each month or how you are maintaining yours. i figured if i can figure out away to use powershell to change the window with some logic somehow but my powershell skill are low so i figured  i would see if anyone might have something they are willing to share that i can start with or point me in the direction of a good reference they used.

Answers ( 5 )

    1
    2020-06-04T00:19:09+05:30

    Why are you changing the MWs every month?
    Create multiple collections with the same devices and set different MWs to them and then just use the deployments to these collections as needed for the timeline required.

    Best answer
      0
      2020-06-04T01:37:55+05:30

      We can only patch servers on a specific weekend each month. They want us to change it each month to make sure servers don’t reboot u expectedly.

    1
    2020-06-03T21:12:59+05:30

    likes like the description is automatically generated and cant be modified.

    0
    2020-06-03T14:54:38+05:30

    Have you already tried this ? anything missing there?

    Setting SCCM Maintenance Windows using PowerShell and System File Watcher
    1. https://sccm-zone.com/setting-sccm-maintenance-windows-using-file-watcher-with-powershell-abaef5bf007b

    2. https://msendpointmgr.com/2019/04/10/patching-how-to-automate-your-maintenance-windows/

      1
      2020-06-03T21:01:42+05:30

      i have been looking at this one. https://gallery.technet.microsoft.com/scriptcenter/SCCM-2012-R2-Change-26aa591d

      i have it working in theory but want to try to change the description but haven been able to figure out how.

      this gives me the description:
      get-CMMaintenanceWindow -CollectionId xxx000fb | select name, starttime, duration, description

      but this wont set it.
      Set-CMMaintenanceWindow -CollectionId $Collection.CollectionID -MaintenanceWindowName $MW.Name -DescriptionName “test” -Schedule $NewSchedule -IsEnabled $true

      was hoping to change the description each month also. not a show stopper but me being picky lol.

Leave an answer

Sorry, you do not have permission to answer to this question .