20.7. Getting Information About Software

An important regular maintenance task is keeping all our software up to date. Of course, the most important piece of software is the operating system. We can use WMI to query the state of installed service packs and updates for all computers on the network and then trigger alarms when something is not up to date, just like we could for hardware queries.

20.7.1. Operating System Updates

The first thing that we may need to check is the operating system version and its installed service packs. We can get that from the Win32_OperatingSystem object for the current machine:

PS> gwmi Win32_OperatingSystem | ' select Name,Version,BuildNumber,' ServicePackMajorVersion,ServicePackMinorVersion | Format-List Name ...

Get Pro Windows PowerShell now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.