Shortcut Menu

Skip

Main Navigation

Choose your language

You are here:

ActiveXperts.com > Administration > Scripts > WMI > Perl > Win32_ComputerSystem

ActiveXperts Network Monitor ships with a large collection of WMI based PowerShell scripts and VBScript scripts to monitor and manage a network.

Use ActiveXperts Netork Monitor to monitor your virtualization servers, domains, computers and devices. It runs on a single Windows server, without agents required on the monitored systems. It has many built-in checks and also allows administrators to create custom checks using PowerShell, VBScript, WMI and SSH.


Win32_ComputerSystem - WMI sample in Perl

The foundations for Manageability in Windows 7/2008/Vista/XP/2000 and Millennium Edition/'98 are Windows Management Instrumentation (WMI; formerly WBEM) and WMI extensions for Windows Driver Model (WDM).

ActiveXperts Network Monitor provides the ability to build monitor check routines based on WMI. ActiveXperts has collected more than a hundred WMI samples. You can use these samples as a base for new check routines you can write yourself.

On this site, you can find many WMI samples.


Win32_ComputerSystem

Description

ActiveXperts Network Monitor ships with a large collection of WMI based PowerShell scripts and VBScript scripts to monitor and manage a network.

Use ActiveXperts Netork Monitor to monitor your virtualization servers, domains, computers and devices. It runs on a single Windows server, without agents required on the monitored systems. It has many built-in checks and also allows administrators to create custom checks using PowerShell, VBScript, WMI and SSH.

Example(s)

use strict;
use Win32::OLE('in');

use constant wbemFlagReturnImmediately => 0x10;
use constant wbemFlagForwardOnly => 0x20;

my @computers = ("DELL17");
foreach my $computer (@computers) {
   print "\n";
   print "==========================================\n";
   print "Computer: $computer\n";
   print "==========================================\n";

   my $objWMIService = Win32::OLE->GetObject("winmgmts:\\\\$computer\\root\\CIMV2") or die "WMI connection failed.\n";
   my $colItems = $objWMIService->ExecQuery("SELECT * FROM Win32_ComputerSystem", "WQL",
                  wbemFlagReturnImmediately | wbemFlagForwardOnly);

   foreach my $objItem (in $colItems) {
      print "AdminPasswordStatus: $objItem->{AdminPasswordStatus}\n";
      print "AutomaticResetBootOption: $objItem->{AutomaticResetBootOption}\n";
      print "AutomaticResetCapability: $objItem->{AutomaticResetCapability}\n";
      print "BootOptionOnLimit: $objItem->{BootOptionOnLimit}\n";
      print "BootOptionOnWatchDog: $objItem->{BootOptionOnWatchDog}\n";
      print "BootROMSupported: $objItem->{BootROMSupported}\n";
      print "BootupState: $objItem->{BootupState}\n";
      print "Caption: $objItem->{Caption}\n";
      print "ChassisBootupState: $objItem->{ChassisBootupState}\n";
      print "CreationClassName: $objItem->{CreationClassName}\n";
      print "CurrentTimeZone: $objItem->{CurrentTimeZone}\n";
      print "DaylightInEffect: $objItem->{DaylightInEffect}\n";
      print "Description: $objItem->{Description}\n";
      print "DNSHostName: $objItem->{DNSHostName}\n";
      print "Domain: $objItem->{Domain}\n";
      print "DomainRole: $objItem->{DomainRole}\n";
      print "EnableDaylightSavingsTime: $objItem->{EnableDaylightSavingsTime}\n";
      print "FrontPanelResetStatus: $objItem->{FrontPanelResetStatus}\n";
      print "InfraredSupported: $objItem->{InfraredSupported}\n";
      print "InitialLoadInfo: " . join(",", (in $objItem->{InitialLoadInfo})) . "\n";
      print "InstallDate: $objItem->{InstallDate}\n";
      print "KeyboardPasswordStatus: $objItem->{KeyboardPasswordStatus}\n";
      print "LastLoadInfo: $objItem->{LastLoadInfo}\n";
      print "Manufacturer: $objItem->{Manufacturer}\n";
      print "Model: $objItem->{Model}\n";
      print "Name: $objItem->{Name}\n";
      print "NameFormat: $objItem->{NameFormat}\n";
      print "NetworkServerModeEnabled: $objItem->{NetworkServerModeEnabled}\n";
      print "NumberOfProcessors: $objItem->{NumberOfProcessors}\n";
      print "OEMLogoBitmap: " . join(",", (in $objItem->{OEMLogoBitmap})) . "\n";
      print "OEMStringArray: " . join(",", (in $objItem->{OEMStringArray})) . "\n";
      print "PartOfDomain: $objItem->{PartOfDomain}\n";
      print "PauseAfterReset: $objItem->{PauseAfterReset}\n";
      print "PowerManagementCapabilities: " . join(",", (in $objItem->{PowerManagementCapabilities})) . "\n";
      print "PowerManagementSupported: $objItem->{PowerManagementSupported}\n";
      print "PowerOnPasswordStatus: $objItem->{PowerOnPasswordStatus}\n";
      print "PowerState: $objItem->{PowerState}\n";
      print "PowerSupplyState: $objItem->{PowerSupplyState}\n";
      print "PrimaryOwnerContact: $objItem->{PrimaryOwnerContact}\n";
      print "PrimaryOwnerName: $objItem->{PrimaryOwnerName}\n";
      print "ResetCapability: $objItem->{ResetCapability}\n";
      print "ResetCount: $objItem->{ResetCount}\n";
      print "ResetLimit: $objItem->{ResetLimit}\n";
      print "Roles: " . join(",", (in $objItem->{Roles})) . "\n";
      print "Status: $objItem->{Status}\n";
      print "SupportContactDescription: " . join(",", (in $objItem->{SupportContactDescription})) . "\n";
      print "SystemStartupDelay: $objItem->{SystemStartupDelay}\n";
      print "SystemStartupOptions: " . join(",", (in $objItem->{SystemStartupOptions})) . "\n";
      print "SystemStartupSetting: $objItem->{SystemStartupSetting}\n";
      print "SystemType: $objItem->{SystemType}\n";
      print "ThermalState: $objItem->{ThermalState}\n";
      print "TotalPhysicalMemory: $objItem->{TotalPhysicalMemory}\n";
      print "UserName: $objItem->{UserName}\n";
      print "WakeUpType: $objItem->{WakeUpType}\n";
      print "Workgroup: $objItem->{Workgroup}\n";
      print "\n";
   }
}sub WMIDateStringToDate(strDate)
{
   return "blah";
}