How To: Enable the “Suppress Program Notifications” Checkbox for all Programs in a Package

In a previous post, I wrote how to enable the “Suppress Program Notifications” Checkbox for Program Properties for all programs in your environment. By request, in this post we’re going to modify the script slightly to modify all programs for one package, given the PackageID.

#Select all programs for one package
#(Update MySiteServer and LAB with your ConfigMgr Server name and Site code, and PackageID with a valid packageID)
$prgs = get-wmiobject sms_program -computername MySiteServer -namespace root\sms\site_LAB -filter "PackageID='LAB0023C'"
$prgs | foreach {
#ProgramFlags are a lazy property, so make explicit call.
$prg = [wmi] $_.__Path
if ($prg.ProgramFlags -band ([math]::pow(2,10)))
{
# Suppress already enabled
}
else
{
# Not suppressed - display programname and packageID
$prg.Programname + "`t" + $prg.PackageiD
# flip the programflags bit to enable suppression
$prg.ProgramFlags = $prg.ProgramFlags -bor ([math]::pow(2,10))
# use Put to save changes
$prg.put()
}
#rinse and repeat
}

The only change we had to make was to add the filter command to the get-wmiobject cmdlet. -filter “PackageID=’LAB0023C'”

 Read more about SMS_Program and ProgramFlags.

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: