Changing the Software Update Package reference of an Automatic Deployment Rule is not possible through the console.
With the following PowerShell script you can change the PackageID through WMI:
################# # Configuration # ################# $newPackageID = "PACKAGEID" $siteCode = "SITECODE" $serverName = "HOSTNAME" # All rules matching the following search string will be updated $searchString = "SUM *" # See what's going to happen before changing anything $test = $TRUE ################# # Code # ################# $autoDeployments = Get-WmiObject -class "SMS_AutoDeployment" -namespace "root\sms\site_$siteCode" -impersonation 3 -computername $serverName | Where-Object {$_.name -like $searchString} Write-Host if ($test) { Write-Host "### TESTMODE - Nothing will be changed ###" Write-Host } foreach ($item in $autoDeployments) { $item = [wmi]"$($item.__PATH)" $xmlContentTempl = $item.ContentTemplate Write-Host "Rule Name:"$item.Name Write-Host "****************************************************" Write-Host "PackageID:"$xmlContentTempl.ContentActionXML.PackageID if ($test) { Write-Host "New PackageID would be:"$newPackageID } else { $xmlContentTempl.ContentActionXML.PackageID = $newPackageID $item.ContentTemplate = $xmlContentTempl.InnerXml Write-Host "Saving changes..." Write-Host $item.put() Write-Host "Changes were saved!" Write-Host "New PackageID:"$xmlContentTempl.ContentActionXML.PackageID } Write-Host }
Principal Workplace Consultant | MVP at baseVISION AG
I’m a consultant, trainer and architect for modern workplace and enterprise mobility projects with Microsoft Technologies in the past eight years. I love to push and design the modern workplace based on Windows 10, EM&S and O365 for my customers which is the only answer for the current security threats, agile world and the fast-changing business requirements of my customers. Important for me is to simplify and automate the operational processes, because there are the highest costs.
Follow me
Latest posts by Thomas Kurth (see all)
- Microsoft Purview Information protect predefined permission groups demystified - February 28, 2023
- Extending Microsoft Sentinel with important device data - January 30, 2023
- SOC Monitor wall – Develop your Video Wall Application (Part 2) - August 22, 2022
2 Comments
AFisher · December 22, 2016 at 17:12
this is not, but the PackageID Object seems to not exist. I have attempted to just pull that info and its just not there. When look at the SMS_AutoDeployment class no PacakageID is listed.. can you help me with what I am missing?
Thomas Kurth · December 22, 2016 at 18:09
Which Version of ConfigMgr are you using? Then I can try to reproduce the Problem.