WMI query for a list of patches installed on the system?

I am writing a perl script that will list the patches installed on my system and check if there were any patches needed before the start of my program,

Therefore, I need to be able to list the fixes in the system; It mentions the use of wmic to generate an html file. Is it possible to do this with a WMI request?

+1
source share
1 answer

I myself understood the answer for this! There is a vbscript option provided here .

The perl version is as follows.

use Win32::OLE qw( in ); my $machine = "."; my $WMIServices = Win32::OLE->GetObject ( "winmgmts:{impersonationLevel=impersonate,(security)}//$machine/root/cimv2" ) || die "cant call getobject"; my $HotFixCollection = $WMIServices->ExecQuery ( "select * from Win32_QuickFixEngineering" ) || die "Query Failed"; foreach my $hotfix ( in( $HotFixCollection )){ $hotfixID = $hotfix->{HotFixID}; print "Hotfix id is $hotfixID \n"; } 
+2
source

Source: https://habr.com/ru/post/1432886/


All Articles