How to: Set Sending Priority of All ConfigMgr Driver Packages with PowerShell

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

About Greg Ramsey
Greg Ramsey, Enterprise Mobility MVP, is a Senior Enterprise Architect at Dell Technologies. He has a B.S. in Computer Sciences and Engineering from Ohio State University and has co-authored many books over the years. Greg is an international speaker, a board member of the Northwest System Center User Group, and the Director of Communications for the Midwest Management Summit.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: