| 72 | 
           rodolico | 
           1 | 
           # perl
  | 
        
        
            | 
            | 
           2 | 
              | 
        
        
            | 
            | 
           3 | 
           # https://gallery.technet.microsoft.com/827da133-e0b1-4d09-85c2-56ed0b92774d
  | 
        
        
            | 
            | 
           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_ComputerSystem","WQL",wbemFlagReturnImmediately | wbemFlagForwardOnly); 
  | 
        
        
            | 
            | 
           14 | 
              | 
        
        
            | 
            | 
           15 | 
           foreach my $objItem (in $colItems) 
  | 
        
        
            | 
            | 
           16 | 
           { 
  | 
        
        
            | 
            | 
           17 | 
                 print "Admin Password Status: $objItem->{AdminPasswordStatus}\n"; 
  | 
        
        
            | 
            | 
           18 | 
                 print "Automatic Reset Boot Option: $objItem->{AutomaticResetBootOption}\n"; 
  | 
        
        
            | 
            | 
           19 | 
                 print "Automatic Reset Capability: $objItem->{AutomaticResetCapability}\n"; 
  | 
        
        
            | 
            | 
           20 | 
                 print "Boot Option On Limit: $objItem->{BootOptionOnLimit}\n"; 
  | 
        
        
            | 
            | 
           21 | 
                 print "Boot Option On WatchDog: $objItem->{BootOptionOnWatchDog}\n"; 
  | 
        
        
            | 
            | 
           22 | 
                 print "Boot ROM Supported: $objItem->{BootROMSupported}\n"; 
  | 
        
        
            | 
            | 
           23 | 
                 print "Bootup State: $objItem->{BootupState}\n"; 
  | 
        
        
            | 
            | 
           24 | 
                 print "Caption: $objItem->{Caption}\n"; 
  | 
        
        
            | 
            | 
           25 | 
                 print "Chassis Bootup State: $objItem->{ChassisBootupState}\n"; 
  | 
        
        
            | 
            | 
           26 | 
                 print "Creation Class Name: $objItem->{CreationClassName}\n"; 
  | 
        
        
            | 
            | 
           27 | 
                 print "Current Time Zone: $objItem->{CurrentTimeZone}\n"; 
  | 
        
        
            | 
            | 
           28 | 
                 print "Daylight In Effect: $objItem->{DaylightInEffect}\n"; 
  | 
        
        
            | 
            | 
           29 | 
                 print "Description: $objItem->{Description}\n"; 
  | 
        
        
            | 
            | 
           30 | 
                 print "Domain: $objItem->{Domain}\n"; 
  | 
        
        
            | 
            | 
           31 | 
                 print "Domain Role: $objItem->{DomainRole}\n"; 
  | 
        
        
            | 
            | 
           32 | 
                 print "Enable Daylight Savings Time: $objItem->{EnableDaylightSavingsTime}\n"; 
  | 
        
        
            | 
            | 
           33 | 
                 print "Front Panel Reset Status: $objItem->{FrontPanelResetStatus}\n"; 
  | 
        
        
            | 
            | 
           34 | 
                 print "Infrared Supported: $objItem->{InfraredSupported}\n"; 
  | 
        
        
            | 
            | 
           35 | 
                 print "Initial Load Info: " . join(",", (in $objItem->{InitialLoadInfo})) . "\n"; 
  | 
        
        
            | 
            | 
           36 | 
                 print "Install Date: $objItem->{InstallDate}\n"; 
  | 
        
        
            | 
            | 
           37 | 
                 print "Keyboard Password Status: $objItem->{KeyboardPasswordStatus}\n"; 
  | 
        
        
            | 
            | 
           38 | 
                 print "Last Load Info: $objItem->{LastLoadInfo}\n"; 
  | 
        
        
            | 
            | 
           39 | 
                 print "Manufacturer: $objItem->{Manufacturer}\n"; 
  | 
        
        
            | 
            | 
           40 | 
                 print "Model: $objItem->{Model}\n"; 
  | 
        
        
            | 
            | 
           41 | 
                 print "Name: $objItem->{Name}\n"; 
  | 
        
        
            | 
            | 
           42 | 
                 print "Name Format: $objItem->{NameFormat}\n"; 
  | 
        
        
            | 
            | 
           43 | 
                 print "Network Server Mode Enabled: $objItem->{NetworkServerModeEnabled}\n"; 
  | 
        
        
            | 
            | 
           44 | 
                 print "Number Of Processors: $objItem->{NumberOfProcessors}\n"; 
  | 
        
        
            | 
            | 
           45 | 
                 print "OEM Logo Bitmap: " . join(",", (in $objItem->{OEMLogoBitmap})) . "\n"; 
  | 
        
        
            | 
            | 
           46 | 
                 print "OEM String Array: " . join(",", (in $objItem->{OEMStringArray})) . "\n"; 
  | 
        
        
            | 
            | 
           47 | 
                 print "Part Of Domain: $objItem->{PartOfDomain}\n"; 
  | 
        
        
            | 
            | 
           48 | 
                 print "Pause After Reset: $objItem->{PauseAfterReset}\n"; 
  | 
        
        
            | 
            | 
           49 | 
                 print "Power Management Capabilities: " . join(",", (in $objItem->{PowerManagementCapabilities})) . "\n"; 
  | 
        
        
            | 
            | 
           50 | 
                 print "Power Management Supported: $objItem->{PowerManagementSupported}\n"; 
  | 
        
        
            | 
            | 
           51 | 
                 print "PowerOn Password Status: $objItem->{PowerOnPasswordStatus}\n"; 
  | 
        
        
            | 
            | 
           52 | 
                 print "Power State: $objItem->{PowerState}\n"; 
  | 
        
        
            | 
            | 
           53 | 
                 print "Power Supply State: $objItem->{PowerSupplyState}\n"; 
  | 
        
        
            | 
            | 
           54 | 
                 print "Primary Owner Contact: $objItem->{PrimaryOwnerContact}\n"; 
  | 
        
        
            | 
            | 
           55 | 
                 print "Primary Owner Name: $objItem->{PrimaryOwnerName}\n"; 
  | 
        
        
            | 
            | 
           56 | 
                 print "Reset Capability: $objItem->{ResetCapability}\n"; 
  | 
        
        
            | 
            | 
           57 | 
                 print "Reset Count: $objItem->{ResetCount}\n"; 
  | 
        
        
            | 
            | 
           58 | 
                 print "Reset Limit: $objItem->{ResetLimit}\n"; 
  | 
        
        
            | 
            | 
           59 | 
                 print "Roles: " . join(",", (in $objItem->{Roles})) . "\n"; 
  | 
        
        
            | 
            | 
           60 | 
                 print "Status: $objItem->{Status}\n"; 
  | 
        
        
            | 
            | 
           61 | 
                 print "Support Contact Description: " . join(",", (in $objItem->{SupportContactDescription})) . "\n"; 
  | 
        
        
            | 
            | 
           62 | 
                 print "System Startup Delay: $objItem->{SystemStartupDelay}\n"; 
  | 
        
        
            | 
            | 
           63 | 
                 print "System Startup Options: " . join(",", (in $objItem->{SystemStartupOptions})) . "\n"; 
  | 
        
        
            | 
            | 
           64 | 
                 print "System Startup Setting: $objItem->{SystemStartupSetting}\n"; 
  | 
        
        
            | 
            | 
           65 | 
                 print "System Type: $objItem->{SystemType}\n"; 
  | 
        
        
            | 
            | 
           66 | 
                 print "Thermal State: $objItem->{ThermalState}\n"; 
  | 
        
        
            | 
            | 
           67 | 
                 print "Total Physical Memory: $objItem->{TotalPhysicalMemory}\n"; 
  | 
        
        
            | 
            | 
           68 | 
                 print "User Name: $objItem->{UserName}\n"; 
  | 
        
        
            | 
            | 
           69 | 
                 print "WakeUp Type: $objItem->{WakeUpType}\n"; 
  | 
        
        
            | 
            | 
           70 | 
                 print "Workgroup: $objItem->{Workgroup}\n"; 
  | 
        
        
            | 
            | 
           71 | 
                 print "\n"; 
  | 
        
        
            | 
            | 
           72 | 
           } 
  | 
        
        
           | 73 | 
           rodolico | 
           73 | 
              | 
        
        
            | 
            | 
           74 | 
           <STDIN>;
  |