View Add/Remove Program Info in Powershell

A quick and easy way to view almost everything you need to know about your add/remove programs is using the “gwmi” powershell command.

To view all options for this, just use the built-in help by typing: get-help gwmi .

To get all of the information on your add/remove programs (or technically called “Installed Software” now)… type:

gwmi -namespace “root\cimv2\sms” -class SMS_InstalledSoftware into powershell.  It may take a few seconds for everything to appear and you’ll see a huge list of all installed applications.

A coworker reminded me of the “out-gridview” command which organizes this into a much more manageable view.

The final product?  Pipe the out-gridview out and it looks like this:

 gwmi -namespace “root\cimv2\sms” -class SMS_InstalledSoftware | Out-GridView



Everything you ever needed will be in here.  The exact name to query for when building SCCM collections, GUID, version, etc.  Limitless possibilities.  The filter is also excellent too.

Hope this helps!



Posted in Powershell, SCCM 2012, Scripts | Tagged , , , , | Leave a comment

Powershell Tips – Reboot Pending?

I’ve managed Configuration Manager 2007 and 2012 at a few organizations where reboots were suppressed for security patches.  Personally, I think 24-48 hours notice is plenty of time for users to reboot their workstations, however many times the decision is made way above my pay grade.

Pending reboots on a system can cause havoc with subsequent advertisements that go out.  I’ve seen many application failures on a system with a pending reboot.  Since most of our application deployments use a Powershell wrapper, I’ve been searching for a way to take a different path if a reboot is pending.  Some applications work just fine with a pending reboot on the system, others not so much.

The following Powershell command will let you determine in the script if a reboot is pending or not with SCCM.

Invoke-WmiMethod -Namespace root\ccm\clientsdk -Class CCM_ClientUtilities -Name DetermineIfRebootPending




Once you have this result, you could pipe it into anything with Powershell.  You could have it exit with a special exit code, do another action like write an entry into a log….. anything really.

I will be posting a few examples of this pending reboot check in the future.  Hope this helps.


Posted in Application Packaging, Powershell, SCCM 2012 | Tagged , , | Leave a comment