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/827da133-e0b1-4d09-85c2-56ed0b92774d
4
 
96 rodolico 5
# simply exit if this is not Windows
6
BEGIN {
7
$^O eq "MSWin32" || exit;
8
}
9
 
72 rodolico 10
use Win32::OLE('in'); 
11
use constant wbemFlagReturnImmediately => 0x10; 
12
use constant wbemFlagForwardOnly => 0x20; 
13
 
14
$computer = "."; 
15
$objWMIService = Win32::OLE->GetObject 
16
    ("winmgmts:\\\\$computer\\root\\CIMV2") or die "WMI connection failed.\n"; 
17
$colItems = $objWMIService->ExecQuery 
18
    ("SELECT * FROM Win32_ComputerSystem","WQL",wbemFlagReturnImmediately | wbemFlagForwardOnly); 
19
 
20
foreach my $objItem (in $colItems) 
21
{ 
22
      print "Admin Password Status: $objItem->{AdminPasswordStatus}\n"; 
23
      print "Automatic Reset Boot Option: $objItem->{AutomaticResetBootOption}\n"; 
24
      print "Automatic Reset Capability: $objItem->{AutomaticResetCapability}\n"; 
25
      print "Boot Option On Limit: $objItem->{BootOptionOnLimit}\n"; 
26
      print "Boot Option On WatchDog: $objItem->{BootOptionOnWatchDog}\n"; 
27
      print "Boot ROM Supported: $objItem->{BootROMSupported}\n"; 
28
      print "Bootup State: $objItem->{BootupState}\n"; 
29
      print "Caption: $objItem->{Caption}\n"; 
30
      print "Chassis Bootup State: $objItem->{ChassisBootupState}\n"; 
31
      print "Creation Class Name: $objItem->{CreationClassName}\n"; 
32
      print "Current Time Zone: $objItem->{CurrentTimeZone}\n"; 
33
      print "Daylight In Effect: $objItem->{DaylightInEffect}\n"; 
34
      print "Description: $objItem->{Description}\n"; 
35
      print "Domain: $objItem->{Domain}\n"; 
36
      print "Domain Role: $objItem->{DomainRole}\n"; 
37
      print "Enable Daylight Savings Time: $objItem->{EnableDaylightSavingsTime}\n"; 
38
      print "Front Panel Reset Status: $objItem->{FrontPanelResetStatus}\n"; 
39
      print "Infrared Supported: $objItem->{InfraredSupported}\n"; 
40
      print "Initial Load Info: " . join(",", (in $objItem->{InitialLoadInfo})) . "\n"; 
41
      print "Install Date: $objItem->{InstallDate}\n"; 
42
      print "Keyboard Password Status: $objItem->{KeyboardPasswordStatus}\n"; 
43
      print "Last Load Info: $objItem->{LastLoadInfo}\n"; 
44
      print "Manufacturer: $objItem->{Manufacturer}\n"; 
45
      print "Model: $objItem->{Model}\n"; 
46
      print "Name: $objItem->{Name}\n"; 
47
      print "Name Format: $objItem->{NameFormat}\n"; 
48
      print "Network Server Mode Enabled: $objItem->{NetworkServerModeEnabled}\n"; 
49
      print "Number Of Processors: $objItem->{NumberOfProcessors}\n"; 
50
      print "OEM Logo Bitmap: " . join(",", (in $objItem->{OEMLogoBitmap})) . "\n"; 
51
      print "OEM String Array: " . join(",", (in $objItem->{OEMStringArray})) . "\n"; 
52
      print "Part Of Domain: $objItem->{PartOfDomain}\n"; 
53
      print "Pause After Reset: $objItem->{PauseAfterReset}\n"; 
54
      print "Power Management Capabilities: " . join(",", (in $objItem->{PowerManagementCapabilities})) . "\n"; 
55
      print "Power Management Supported: $objItem->{PowerManagementSupported}\n"; 
56
      print "PowerOn Password Status: $objItem->{PowerOnPasswordStatus}\n"; 
57
      print "Power State: $objItem->{PowerState}\n"; 
58
      print "Power Supply State: $objItem->{PowerSupplyState}\n"; 
59
      print "Primary Owner Contact: $objItem->{PrimaryOwnerContact}\n"; 
60
      print "Primary Owner Name: $objItem->{PrimaryOwnerName}\n"; 
61
      print "Reset Capability: $objItem->{ResetCapability}\n"; 
62
      print "Reset Count: $objItem->{ResetCount}\n"; 
63
      print "Reset Limit: $objItem->{ResetLimit}\n"; 
64
      print "Roles: " . join(",", (in $objItem->{Roles})) . "\n"; 
65
      print "Status: $objItem->{Status}\n"; 
66
      print "Support Contact Description: " . join(",", (in $objItem->{SupportContactDescription})) . "\n"; 
67
      print "System Startup Delay: $objItem->{SystemStartupDelay}\n"; 
68
      print "System Startup Options: " . join(",", (in $objItem->{SystemStartupOptions})) . "\n"; 
69
      print "System Startup Setting: $objItem->{SystemStartupSetting}\n"; 
70
      print "System Type: $objItem->{SystemType}\n"; 
71
      print "Thermal State: $objItem->{ThermalState}\n"; 
72
      print "Total Physical Memory: $objItem->{TotalPhysicalMemory}\n"; 
73
      print "User Name: $objItem->{UserName}\n"; 
74
      print "WakeUp Type: $objItem->{WakeUpType}\n"; 
75
      print "Workgroup: $objItem->{Workgroup}\n"; 
76
      print "\n"; 
77
} 
73 rodolico 78
 
79
<STDIN>;