
Hi All,
often, when i go to customers, i need to create and update a software update group for reporting so they can get a easy way to know if they are compliance with the deployed update groups…
ps. you ay need to change the CategoryInstance_UniqueID to add the products and classifications you have in your environment.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
$SiteCode = "CLC" Invoke-CMSoftwareUpdateSummarization Start-Sleep 30 $updates = gwmi -namespace "root\sms\site_$sitecode" -Query "SELECT ci.CI_ID FROM SMS_SoftwareUpdate ci WHERE ci.IsDeployed ='1' and ci.IsExpired ='0' and ci.IsSuperseded ='0' and ( ci.CI_ID not in (select CI_ID from SMS_CIAllCategories where CategoryInstance_UniqueID = 'UpdateClassification:e0789628-ce08-4437-be74-2495b842f43b') ) AND ( ci.CI_ID not in (select CI_ID from SMS_CIAllCategories where CategoryInstance_UniqueID = 'Product:a38c835c-2950-4e87-86cc-6911a52c34a3') )" $updList = @() $updates | foreach { $updList += $_.CI_ID } $UpdGroup = Get-CMSoftwareUpdateGroup -Name "Reporting: Windows and Office Updates" if ($UpdGroup -eq $null) { $UpdGroup = New-CMSoftwareUpdateGroup -Name "Reporting: Windows and Office Updates" -Description "Update Group used for Compliance reporting" -UpdateId $updList } else { Set-CMSoftwareUpdateGroup -Name "Reporting: Windows and Office Updates" -UpdateId $updList } Invoke-WmiMethod -namespace "root\sms\site_$sitecode" -class SMS_AuthorizationList -Name RunAuthListStatusSummarization -argumentlist $UpdGroup.CI_ID Start-Sleep 30 |