How to: Set Sending Priority of All ConfigMgr Driver Packages with PowerShell
February 22, 2012 Leave a comment
Here’s a quick answer to a post yesterday on myITForum’s ConfigMgr/SMS Email list.
#replace MySiteServer with central site server name, #and LAB with site code get-wmiobject sms_driverpackage -namespace root\sms\site_LAB -computer MySiteServer -filter "Priority <> 3" | foreach { $_.Priority = 3 $_.Put() }
Use this script to set the Sending Priority to Low for all ConfigMgr driver packages. You can see in the script, we query the SMS_DriverPackage class for all Driver packages that do not have a Priority = 3, and then enumerate each one, set the Priority property to 3 (3=Low, 2=Medium, 1=High) and then used the Put() method to save the change. Here’s a brief list of the classes that you can use modify sending priority by simply replacing the class name in the script above:
SMS_PackageBaseClass – This is the base class for all package class. Use extreme care (and testing) when running scripts against SMS_BasePackagClass.
SMS_DriverPackage
SMS_ContentPackage – new to ConfigMgr 2012, this is for Applications, no SDK Doc currently available.
SMS_OperatingSystemInstallPackage
SMS_SoftwareUpdatesPackage
SMS_TaskSequencePackage
SMS_ImagePackage
SMS_BootImagePackage
SMS_Package
You can also use the get-wmiobject –filter command to find a specific package. Just change -filter “Priority <> 3” to –Filter “PackageID=’LAB00028′”
Bonus TIP: Here’s a quick script to show the count of each Package type using the group-object cmdlet:
#replace MySiteServer with central site server name, #and LAB with site code get-wmiobject sms_packagebaseclass -namespace root\sms\site_LAB -computer MySiteServer | group-object __Class | select-object Name, Count
Happy Scripting,
Greg