ConfigMgr Site Maintenance Task Powershell Module

Use this Powershell module to get your SCCM site maintenance tasks, disable and enable them.

4.5 Star
1,252 times
Add to favorites
System Center
E-mail Twitter Digg Facebook
  • Days of Week equal obscure number
    1 Posts | Last post March 21, 2018
    • I added this line to the ($WhereBlock) 
      $SiteMaintenance = Get-WmiObject @WmiParams | where $WhereBlock 
      so I could use Write-Host to display to screen as shown below.
      Foreach ($Task in $SiteMaintenance){
      $DayofWeek = $Task.DaysOfWeek
      Write-Host "SCCM Site Maintenance Task - " -ForegroundColor Green -NoNewline
      Write-Host $Task.ItemName -ForegroundColor Yellow
      Write-Host "Day of the week for running - " -ForegroundColor Green  -NoNewline
      Write-Host $DayofWeek -ForegroundColor Yellow
      The Days of the week are coming out in numbers I don't understand such as 127, 41, 118. 9. 
      What do these numbers mean? I know they are showing the Days of the week that the maintenance task runs such as the number 41 corresponds to Wednesday, Friday and Sunday on
      the Backup Site Server task.
  • It appear that Class and Query are mutually exclusive?
    1 Posts | Last post September 27, 2017
      Get-WmiObject : Parameter set cannot be resolved using the specified named parameters.
      PS C:\Windows\system32> $WmiParams
      Name                           Value                                                                                                                                                                          
      ----                           -----                                                                                                                                                                          
      Query                          SELECT * FROM SMS_SCI_SQLTask WHERE (ItemName LIKE '%')                                                                                                                        
      Computername                   SCCMSERVER1                                                                                                                                                                  
      Namespace                      root\sms\site_AAA                                                                                                                                                              
      Class                          SMS_SCI_SQLTask 
      It looks like query or class can be used in the splatting, but not both. When I comment out the lines with $WmiParams.Class, the problem goes away. I'm not sure if this was a change to Get-WmiObject since your script was released.