Setting Maintenance Windows in SCCM 2012 R2 With Powershell

 Using Powershell cmdlets new SCCM 2012 R2 in you-can set maintenance windows Overcoming the Limitations imposed on collections by the GUI console . Script always calculates second tuesday of the month and THEN Specified Patch offsets the day by speciffied days and weeks to be

 
 
 
 
 
(0)
Add to favorites
System Center
3/31/2015
E-mail Twitter del.icio.us Digg Facebook
  • Error: "Invalid cast from 'DateTime' to 'Int32'."
    1 Posts | Last post September 06, 2017
    • I'm running into the issue of "Cannot convert value "9/12/2017 12:00:00 AM" to type "System.Int32". Error: "Invalid cast from 'DateTime' to 'Int32'." This comes from the last line of:
      
      Set-MaintenanceWindow $PatchMonth -PatchDay $PatchDay -CollectionID $CollectionID -DaysAfterPT $DaysAfterPT -StartHour $StartHour -StartMinute $StartMinute -EndHour $EndHour -EndMinute $EndMinute -UTC $UTC
      
      Any idea on the conversion needed?