Subversion Repositories camp_sysinfo_client_3

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
72 rodolico 1
#! perl
2
 
3
# https://gallery.technet.microsoft.com/bdf35c43-9415-4e1c-9cfe-e035e38ba694
4
 
5
use Win32::OLE('in'); 
6
use constant wbemFlagReturnImmediately => 0x10; 
7
use constant wbemFlagForwardOnly => 0x20; 
8
 
9
$computer = "."; 
10
$objWMIService = Win32::OLE->GetObject 
11
    ("winmgmts:\\\\$computer\\root\\CIMV2") or die "WMI connection failed.\n"; 
12
$colItems = $objWMIService->ExecQuery 
13
    ("SELECT * FROM Win32_SoftwareFeature","WQL",wbemFlagReturnImmediately | wbemFlagForwardOnly); 
14
 
15
foreach my $objItem (in $colItems) 
16
{ 
17
      print "Accesses: $objItem->{Accesses}\n"; 
18
      print "Attributes: $objItem->{Attributes}\n"; 
19
      print "Caption: $objItem->{Caption}\n"; 
20
      print "Description: $objItem->{Description}\n"; 
21
      print "Identifying Number: $objItem->{IdentifyingNumber}\n"; 
22
      print "Install Date: $objItem->{InstallDate}\n"; 
23
      print "Install State: $objItem->{InstallState}\n"; 
24
      print "Last Use: $objItem->{LastUse}\n"; 
25
      print "Name: $objItem->{Name}\n"; 
26
      print "Product Name: $objItem->{ProductName}\n"; 
27
      print "Status: $objItem->{Status}\n"; 
28
      print "Vendor: $objItem->{Vendor}\n"; 
29
      print "Version: $objItem->{Version}\n"; 
30
      print "\n"; 
31
}