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

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_ContentPackage – new to ConfigMgr 2012, this is for Applications, no SDK Doc currently available.

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,


Fun with WMIC

(When preparing to write this brief post, I see that my MVP colleague Sherry Kissinger also has a post on WMIC and Windows Installer. Check it out – it’s a good read too.) 

Here are a couple more examples to add to your tool belt, especially when working with teammates in remote offices, and you need information from WinPE. My perfect example is that a tech reports in that OSD isn’t working, the symptom is that no fixed disks appear to be present on the system. This error usually means that you don’t have a mass storage driver in WinPE for the hardware. Of course, this error can also mean that you have a hard disk error, or that it’s not connected to your system.

Back to task, here are two example command lines for querying win32_pnpentity to display all Plug-and-Play information for a system.

Wmic /namespace:\\ROOT\cimv2 path win32_pnpentity get /format:hform >”c:\temp\data.htm”

Wmic /namespace:\\ROOT\cimv2 path win32_pnpentity get /format:csv >”c:\temp\test.csv”

The first example writes the information to a .htm file, and the second writes the information to a .csv file.

Once you have the PNP IDs, you can begin your journey to find the appropriate mass storage drivers.

More info: Creating and editing formats in WMIC.