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 is a systems engineer specializing in global systems management for Dell IT. He has a B.S. in Computer Sciences and Engineering from the Ohio State University and is a Microsoft Most Valuable Professional (MVP) for Microsoft System Center Configuration Manager. Greg coauthored SMS 2003 Recipes: A Problem-Solution Approach (Apress, 2006), Microsoft System Center Configuration Manager Unleashed (Sams, 2009), Microsoft System Center 2012 Configuration Manager Unleashed (Sams, 2012), and Microsoft System Center 2012 Configuration Manager: Administration Cookbook (Packt Publishing, 2012), and Microsoft System Center 2012 Configuration Manager R2 Unleashed (Sams, 2012). Greg is cofounder of the Ohio SMS Users Group, and the Central Texas Systems Management User Group.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: