Skip to main content

Posts

Showing posts with the label Hotfixes

Using Windows update agent object model to get all installed hotfixes (KBs)

A simple bit of code to get all the installed hot-fixes for an MS operating system - we do this so we can log any machines in the enterprise missing the required patches. Windows update agent object model or WuApi makes this very easy - just add a reference to the WuApi COM interop library and you're away. You'll see below I'm using regular expression to match the hotfix naming convention, e.g. KB2484841. Loading .... I'm using a custom disposable object call ComDisposable and an extension method to add the COM interop types to the ComDisposble, these are there just to make sure they get cleared down at the end: Loading ....