If you are administering (or somehow related to) any kind of network, you may wish to periodically acquire a more-or-less complete image of what's happening in your PCs. The presented script was created to ease the task of keeping track of hardware and software components throughout the enterprise; it queries all the WMI classes that I think are useful to monitor. The script was designed to accomplish the following goals:
This article is in no way a tutorial on WMI; it just explains what the accompanying tool is and how it works. Using the tool doesn't require anything beyond the basic knowledge of Windows Management Instrumentation; understanding and extending the tool requires a programming experience with Windows Scripting Host, JScript language and Microsoft XML library.
The common way of using the tool is through the wmi_admin.hta page. UI is fairly obvious.
Script (scripts/wmiadmin.js) can be also run from the command line.
You can run the script by running the wmiadmin.js file. Shell command:
[cscript] wmiadmin.js
collects info on the local computer and opens the resulting XML file (named result-127-0-0-1.xml) in a browser; and
[cscript] wmiadmin.js xxx.xxx.xxx.xxx
collects info about the computer whose IP address is xxx.xxx.xxx.xxx, creates the resulting XML file named result-xxx-xxx-xxx-xxx.xml and opens it in a browser. You can specify any number of IP addresses as you wish:
xxx.xxx.xxx.xxx
[cscript] wmiadmin.js xxx.xxx.xxx.xxx yyy.yyy.yyy.yyy zzz.zzz.zzz.zzz
creates result-xxx-xxx-xxx-xxx.xml, result-yyy-yyy-yyy-yyy.xml, result-zzz-zzz-zzz-zzz.xml files and opens them in a browser.
Specifying /silent key runs the script in a 'silent mode':
/silent
[cscript] wmiadmin.js /silent
collects info about the local computer and doesn't show the resulting XML file;
[cscript] wmiadmin.js /silent xxx.xxx.xxx.xxx yyy.yyy.yyy.yyy
collects info about the computers with IPs xxx.xxx.xxx.xxx and yyy.yyy.yyy.yyy, and doesn't show the resulting XML files.
yyy.yyy.yyy.yyy
Specifying /username:name and /password:pass gives you a chance to use alternative credentials instead of those provided by the system:
/username:name
/password:pass
[cscript] wmiadmin.js /username:alice /password:anywordyoulike xxx.xxx.xxx.xxx
collects info about the computer with IP xxx.xxx.xxx.xxx using username alice and password anywordyoulike and shows the resulting XML file.
/domain and /auth keys allow you to specify the target domain and the way you authenticate on this domain. If this key value is equal to "kerberos", Kerberos authentication is used; otherwise, NTLM authentication is used:
/domain
/auth
[cscript] wmiadmin.js /domain:acme /username:alice /password:anywordyoulike /auth:kerberos xxx.xxx.xxx.xxx
The process of gathering system info consists of:
this._SetupService = function(ip) { if(!this._service[ip]) { var locator = new ActiveXObject("WbemScripting.SWbemLocator"); this._service[ip] = locator.ConnectServer(ip, "root\\cimv2", this._username, this._password, "", this._domain ? (this._kerberos ? ("kerberos:" + this._domain) : ("NTLMDOMAIN:" + this._domain)) : ""); this._service[ip].Security_.ImpersonationLevel = 3; } this._curserv = this._service[ip]; }
_ExecQuery
_ExecQueryWithWhereClause
WMIcollector
this._ExecQuery = function(className) { return this._curserv.InstancesOf(className); } this._ExecQueryWithWhereClause = function(className, condition) { return this._curserv.ExecQuery("Select * from " + className + " Where " + condition); }
The following is one of the many query routines:
this._collect1394ControllerInfo = function() { var fc = new Enumerator(runQuery("Win32_1394Controller")); var xmlDoc = null, colItem = null, numItems = 0; for (; !fc.atEnd(); fc.moveNext()) numItems++; if(numItems > 0) { xmlDoc = new ActiveXObject("Msxml2.DOMDocument"); if(numItems > 1) { colItem = xmlDoc.createElement("Item"); xmlDoc.appendChild(colItem); this._xmlSetAttribute(xmlDoc, colItem, "name", "IEEE 1394 Controllers"); } var i = 1; for (fc.moveFirst(); !fc.atEnd(); fc.moveNext()) { var Obj = fc.item(); var root, num = ""; if(colItem != null) { root = xmlDoc.createElement("Element"); num = " " + String(i); } else { root = xmlDoc.createElement("Item"); } this._xmlSetAttribute(xmlDoc, root, "name", "IEEE 1394 Controller" + num); if(colItem != null) { colItem.appendChild(root); } else { xmlDoc.appendChild(root); } this._xmlCreateChildTextNode(xmlDoc, root, "Availability", translate_availability(Obj.Availability)); this._xmlCreateChildTextNodeWithAttribute(xmlDoc, root, "DeviceID", Obj.DeviceID, "name", "Device ID"); this._xmlCreateChildTextNode(xmlDoc, root, "Manufacturer", Obj.Manufacturer); this._xmlCreateChildTextNode(xmlDoc, root, "Name", Obj.Name); this._xmlCreateChildTextNode(xmlDoc, root, "Status", Obj.Status); i++; } } return xmlDoc; }
Five helper functions - a thin wrapper to Microsoft XML parser - are used. Common parameters are:
doc
Msxml2.DOMDocument
parent
node
IXMLDOMElement
nodeName
attributeName
attributeValue
nodeContent
// Add an attribute to node. this._xmlSetAttribute = function(doc, node, attributeName, attributeValue) { var Attribute = doc.createAttribute(attributeName); var AttributeText = doc.createTextNode(this._trim(attributeValue)); Attribute.appendChild(AttributeText); node.setAttributeNode(Attribute); } // Create a child node and append it to parent node. this._xmlCreateChildNode = function(doc, parent, nodeName) { var Element = doc.createElement(nodeName); parent.appendChild(Element); return Element; } // Create a child node and append it to parent node; // then add an attribute to newly created child node. this._xmlCreateChildNodeWithAttribute = function(doc, parent, nodeName, attributeName, attributeValue) { var Element = doc.createElement(nodeName); parent.appendChild(Element); this._xmlSetAttribute(doc, Element, attributeName, attributeValue); return Element; } // Create a child node and append it to parent node; // populate child node with nodeContent. this._xmlCreateChildTextNode = function(doc, parent, nodeName, nodeContent) { var str = this._trim(String(nodeContent)); if(this._isempty(str)) return null; var Element = doc.createElement(nodeName); var ElementText = doc.createTextNode(str); parent.appendChild(Element); Element.appendChild(ElementText); return Element; } // Create a child node and append it to parent node; // populate child node with nodeContent, then add an // attribute to newly created child node. this._xmlCreateChildTextNodeWithAttribute = function(doc, parent, nodeName, nodeContent, attributeName, attributeValue) { var str = this._trim(String(nodeContent)); if(this._isempty(str)) return null; var Element = doc.createElement(nodeName); var ElementText = doc.createTextNode(str); parent.appendChild(Element); Element.appendChild(ElementText); this._xmlSetAttribute(doc, Element, attributeName, attributeValue); return Element; }
The resulting XML tree has the following structure:
<Root> <Metadata> <IP> - IP address queried <Date> - Date (local) when the query was run <Time> - Time (local) when the query was run <Hardware> <Item name="item name"> - in case of a single item under a category <characteristic1 name="characteristic1 name"> ... <characteristicN name="characteristicN name"> ... <Item name="item collection name"> - in case of several items under one category <Element name="name of a distinct item"> <characteristic1 name="characteristic1 name"> ... <characteristicN name="characteristicN name"> ... ... <Software> - the same substructure as in <Hardware> ...
The RunQuery method of WMIcollector object is, actually, the main function of the script:
RunQuery
this.RunQuery = function() { for(var i = 0; i < this._ip.length; i++) { var cur_ip = this._ip[i]; // Main call: this._xml[cur_ip] = this._collectAll(cur_ip); } }
_collectAll, in turn, calls all the info-collecting functions.
_collectAll
The script flow can be described as:
All of the above (except 2nd item) is done outside of WMICollector object:
WMICollector
if(typeof(WScript) == "object") { var local_ip = "127.0.0.1"; var wmic = null; var Args = WScript.Arguments; if(!Args.length) { wmic = new WMIcollector(local_ip); } else { var ArgsNamed = Args.Named, ArgsUnnamed = Args.Unnamed; var username = ArgsNamed.Exists("username") ? ArgsNamed.Item("username") : null; var password = ArgsNamed.Exists("password") ? ArgsNamed.Item("password") : null; var domain = ArgsNamed.Exists("domain") ? ArgsNamed.Item("domain") : null; var silent = ArgsNamed.Exists("silent"); var secure = ArgsNamed.Exists("auth") ? (ArgsNamed.Item("auth") == "kerberos") : false; var ips = []; for(var i = 0; i < ArgsUnnamed.length; i++) ips[ips.length] = ArgsUnnamed(i); if(!ips.length) ips[0] = local_ip; wmic = new WMIcollector(ips, username, password, domain, secure); } wmic.RunQuery(); var fso = new ActiveXObject("Scripting.FileSystemObject"); // SAXreader/MXXMLwriter are used to create & save 'neat' xml files. // var writer = new ActiveXObject("Msxml2.MXXMLWriter.3.0"); writer.indent = true; // write xml in a 'pretty printed'-way writer.omitXMLDeclaration = true; var reader = new ActiveXObject("Msxml2.SAXXMLReader.3.0"); reader.contentHandler = writer; reader.errorHandler = writer; // // You can also use 'Msxml2.SAXXMLReader.4.0' and // 'Msxml2.MXXMLWriter.4.0' // (= more detailed error messages) with MSXML 4.0 (or higher) // installed. for(ip in wmic._xml) { var fname = "result-" + String(ip).replace(/\./g, "-") + ".xml"; // Note on creating & saving xml files: // // if you are sure that computers you query return nothing that falls // out of an ordinary ASCII charset, you may wish to switch back to // saving single-byte data (by switching the last parameter of // 'CreateTextFile' to 'false' and changing 'encoding' variable to // 'UTF-8', 'iso-8859-1', // 'Windows-1250' or anything that fits your locale), thus saving // ~50% of disk space. // // 1st parameter - file name; // 2nd parameter - overwrite existing file (true/false); // 3rd parameter - create unicode (true) or ASCII(false) file. // var xmlFile = fso.CreateTextFile(fname, true, true); // Change this encoding to any that fits: // (having created the unicode file, you should keep it UTF-16) // var encoding = "UTF-16"; reader.parse(wmic._xml[ip]); xmlFile.WriteLine("<?xml version=\"1.0\" encoding=\"" + encoding + "\"?>"); xmlFile.WriteLine("<?xml-stylesheet type=\"text/xsl\" href=\"wmiadmin.xsl\"?>"); xmlFile.Write(writer.output); // You can comment all the preceeding SAXreader/ // MXXMLwriter stuff and uncomment the following line to: // 1) write 'unformatted' (single-line) xml to a file, // thus save ~7-10% disk space; // 2) speed things up. // xmlFile.Write("<?xml version=\"1.0\" encoding=\"" + // encoding + "\"?><?xml-stylesheet type=\"text/xsl\" // href=\"wmiadmin.xsl\"?>" + result.xml); xmlFile.Close(); if(!silent) { var Path = WScript.ScriptFullName; Path = Path.substring(0, Path.lastIndexOf("\\")); // To view using MS IE: var ie = new ActiveXObject("InternetExplorer.Application"); ie.visible = true; ie.navigate("file://" + Path + "/" + fname); // To view the file in your default browser: /* var shl = new ActiveXObject("WScript.Shell"); shl.Run(fname); */ } } }
One more thing to look at is the wmiadmin.xsl file (included in the accompanying archive). This rather straightforward XSLT stylesheet is an example of how you can convert the resulting XML tree to a more readable form.
There are several pitfalls you must be aware of:
A PC's availability can be checked by pinging the target computer through Win32_PingStatus. However, this class is only accessible in Windows XP / Windows 2003 Server (or later). Under other versions of Windows, you must explicitly call the ping utility and analyze its output:
Win32_PingStatus
ping
function Ping(ip) { if(ip == "") ip = "127.0.0.1"; var oShell = new ActiveXObject("WScript.Shell"); var oScriptExec = oShell.Exec("ping -n 2 -w 1000 " + ip); var strPingResults = oScriptExec.StdOut.ReadAll(); strPingResults.toLowerCase(); if(strPingResults.indexOf("reply from") != -1) { // ping's answer depends on Windows language version, // so be careful: // if(strPingResults.indexOf("destination net unreachable") != -1) { return (ip + "did not respond to ping."); } else { return (ip + " responded to ping."); } } else return (ip + " did not respond to ping."); }
All the arrays that WMI provides are VB-safearrays and cannot be indexed directly. Use the Enumerator object:
// Extracting info from BiosCharacteristics[] array of // <a href="%22%22http://msdn.microsoft.com/library/en-us/wmisdk/wmi/win32_bios.asp%22%22">Win32_BIOS</a> class: if(Obj.BiosCharacteristics != null) { var char_node = this._xmlCreateChildNodeWithAttribute(xmlDoc, root, "BIOSCharacteristics", "name", "BIOS Features"); var i_count = 1; // Convert VB safearray to JS array: var chars_ar = Obj.BiosCharacteristics.toArray(); var chars_en = new Enumerator(chars_ar); // Iterate through the array: for (; !chars_en.atEnd(); chars_en.moveNext()) { var ch_obj = chars_en.item(); this._xmlCreateChildTextNodeWithAttribute(xmlDoc, char_node, "Characteristic_" + String(i_count), translate_bios_feats(ch_obj), "name", "Feature " + String(i_count)); i_count++; } }
A very special case of property is the "attribute bitmap", which contains a merger (produced by logical OR) of several distinct values. These values can be extracted by testing the bitmap (with the logical AND) against every possible value that it can contain:
// Taken from <a href="%22%22http://msdn.microsoft.com/library/en-us/wmisdk/wmi/win32_printer.asp%22%22">Win32_Printer</a> handler: var attrib_node = this._xmlCreateChildNode(xmlDoc, root, "Attributes"); if(Obj.Attributes & 0x1) this._xmlCreateChildTextNodeWithAttribute(xmlDoc, attrib_node, "Attribute1", "true", "name", "Print jobs are buffered and queued"); if(Obj.Attributes & 0x2) this._xmlCreateChildTextNodeWithAttribute(xmlDoc, attrib_node, "Attribute2", "true", "name", "Document to be sent directly to the printer"); if(Obj.Attributes & 0x4) this._xmlCreateChildTextNodeWithAttribute(xmlDoc, attrib_node, "Attribute3", "true", "name", "Default printer on a computer"); if(Obj.Attributes & 0x8) this._xmlCreateChildTextNodeWithAttribute(xmlDoc, attrib_node, "Attribute4", "true", "name", "Available as a shared network resource"); if(Obj.Attributes & 0x10) this._xmlCreateChildTextNodeWithAttribute(xmlDoc, attrib_node, "Attribute5", "true", "name", "Attached to a network"); if(Obj.Attributes & 0x20) this._xmlCreateChildTextNodeWithAttribute(xmlDoc, attrib_node, "Attribute6", "true", "name", "Hidden from some users on the network"); if(Obj.Attributes & 0x40) this._xmlCreateChildTextNodeWithAttribute(xmlDoc, attrib_node, "Attribute7", "true", "name", "Directly connected to a computer"); if(Obj.Attributes & 0x80) this._xmlCreateChildTextNodeWithAttribute(xmlDoc, attrib_node, "Attribute8", "true", "name", "Enable the queue on the printer if available"); if(Obj.Attributes & 0x100) this._xmlCreateChildTextNodeWithAttribute(xmlDoc, attrib_node, "Attribute9", "true", "name", "Spooler should not delete" + " documents after they are printed"); if(Obj.Attributes & 0x200) this._xmlCreateChildTextNodeWithAttribute(xmlDoc, attrib_node, "Attribute10", "true", "name", "Start jobs that are finished spooling first"); if(Obj.Attributes & 0x400) this._xmlCreateChildTextNodeWithAttribute(xmlDoc, attrib_node, "Attribute11", "true", "name", "Queue print jobs when a printer is not available"); if(Obj.Attributes & 0x800) this._xmlCreateChildTextNodeWithAttribute(xmlDoc, attrib_node, "Attribute12", "true", "name", "Enable bi-directional printing"); if(Obj.Attributes & 0x1000) this._xmlCreateChildTextNodeWithAttribute(xmlDoc, attrib_node, "Attribute13", "true", "name", "Allow only raw data type jobs to be spooled"); if(Obj.Attributes & 0x2000) this._xmlCreateChildTextNodeWithAttribute(xmlDoc, attrib_node, "Attribute14", "true", "name", "Published in the network directory service");
Many properties are of the type integer. To convert any of these uints to readable form, you must write a translation function like this:
integer
uint
// For 'availability' property: this._translate_availability(code) { if(this._isempty(code)) return ""; switch(code) { case 1: return "Other"; break; case 3: return "Running / Full Power"; break; case 4: return "Warning"; break; case 5: return "In Test"; break; case 6: return "Not Applicable"; break; case 7: return "Power Off"; break; case 8: return "Off Line"; break; case 9: return "Off Duty"; break; case 10: return "Degraded"; break; case 11: return "Not Installed"; break; case 12: return "Install Error"; break; case 13: return "Power Save - Unknown"; break; case 14: return "Power Save - Low Power Mode"; break; case 15: return "Power Save - Standby"; break; case 16: return "Power Cycle"; break; case 17: return "Power Save - Warning"; break; default: return "Unknown"; break; } }
Functions have been written for (almost) every 'translatable' property. If you notice something uncovered, please let me know.
This problem falls into two parts:
Both tasks are performed by two lines of code in the RunQuery method:
this.RunQuery = function() { ... // The 3rd parameter - 'true' - says that we're // creating a Unicode file. var xmlFile = fso.CreateTextFile(fname, true, true); // XML tree charset: var encoding = "UTF-16"; ... }
Joining Unicode-type file and UTF-16 XML tree together is the universal method for delivering compatible XML files. However, if you are absolutely sure that computers you query return nothing that falls out of an ordinary ASCII charset, you may wish to switch back to saving single-byte data (by switching the last parameter of 'CreateTextFile' to 'false' and changing the 'encoding' variable to 'UTF-8', 'iso-8859-1', or any other charset that fits your locale), thus saving 50% of the disk space.
CreateTextFile
false
encoding
UTF-8
iso-8859-1
For production (or just aesthetic) purposes, it may be useful to write XML tree in a 'neat', i.e. indented style. This is done by using SAXXMLReader and MXXMLWriter objects:
SAXXMLReader
MXXMLWriter
this.RunQuery = function() { ... // SAXreader/MXXMLwriter are used to create & save 'neat' xml files. // var writer = new ActiveXObject("Msxml2.MXXMLWriter.3.0"); writer.indent = true; // write xml in a 'pretty printed'-way writer.omitXMLDeclaration = true; var reader = new ActiveXObject("Msxml2.SAXXMLReader.3.0"); reader.contentHandler = writer; reader.errorHandler = writer; // //You can also use 'Msxml2.SAXXMLReader.4.0' and //'Msxml2.MXXMLWriter.4.0' //(= more detailed error messages) with MSXML 4.0 (or higher) installed. ... var result = this._collectAll(cur_ip); // result now contains xml complete tree (w/o xml declaration) reader.parse(result.xml); xmlFile.WriteLine("<?xml version=\"1.0\" encoding=\"" + encoding); xmlFile.WriteLine("\"?>"); xmlFile.WriteLine("<?xml-stylesheet type=\"text/xsl\" "); xmlFile.WriteLine("href=\"wmiadmin.xsl\"?>"); xmlFile.Write(writer.output); xmlFile.Close(); ... }
Nevertheless, you can always switch to a simpler (== faster) method of writing a single-line file (which will save you ~7-10% of the disk space):
... xmlFile.Write("<?xml version=\"1.0\" encoding=\"" + encoding + "\"?><?xml-stylesheet type=\"text/xsl\" href=\"wmiadmin.xsl\"?>" + result.xml); xmlFile.Close(); ...
Time has come to review the results and think of the future.
Evolution of wmiadmin tool is not finished. Feel free to write to me all your opinions and suggestions, bugs you've faced and features you'd like to see.
Win32_1394Controller
uint16 Availability
string DeviceID
string Manufacturer
string Name
string Status
Win32_BaseBoard
string Model
string Product
string Version
Win32_BIOS
uint16 BiosCharacteristics[]
string IdentificationCode
datetime ReleaseDate
Win32_InfraredDevice
Win32_ParallelPort
Win32_PCMCIAController
Win32_PhysicalMemory
string BankLabel
uint64 Capacity
uint16 FormFactor
boolean HotSwappable
uint16 MemoryType
string SerialNumber
uint32 Speed
Win32_PortConnector
string InternalReferenceDesignator
boolean PoweredOn
Win32_Processor
uint16 Architecture
string Caption
uint16 CpuStatus
uint32 CurrentClockSpeed
uint16 CurrentVoltage
uint16 Family
uint32 MaxClockSpeed
string ProcessorId
uint16 ProcessorType
uint16 Revision
string Role
string SocketDesignation
Win32_IDEController
uint64 MaxNumberControlled
uint16 ProtocolSupported
Win32_SCSIController
string DriverName
string HardwareVersion
uint64 MaxTransferRate
uint16 ProtectionManagement
Win32_SerialPort
uint32 MaxBaudRate
string ProviderType
Win32_SoundDevice
string ProductName
Win32_USBController
Win32_DesktopMonitor
uint16 DisplayType
string MonitorManufacturer
string MonitorType
uint32 PixelsPerXLogicalInch
uint32 PixelsPerYLogicalInch
uint32 ScreenHeight
uint32 ScreenWidth
Win32_VideoController
string AdapterDACType
uint32 AdapterRAM
uint32 CurrentRefreshRate
string Description
datetime DriverDate
string DriverVersion
uint32 MaxRefreshRate
uint32 MinRefreshRate
boolean Monochrome
uint16 VideoArchitecture
uint16 VideoMemoryType
string VideoModeDescription
string VideoProcessor
Win32_CDROMDrive
string Drive
boolean DriveIntegrity
uint64 MaxMediaSize
string MediaType
uint64 Size
Win32_DiskDrive
Win32_FloppyDrive
Win32_TapeDrive
uint16 Capabilities[]
uint32 Compression
string CompressionMethod
uint32 ECC
string ErrorMethodology
uint32 FeaturesHigh
uint32 FeaturesLow
string Id
uint32 NumberOfMediaSupported
string PNPDeviceID
uint32 ReportSetMarks
Win32_Keyboard
string Layout
uint16 NumberOfFunctionKeys
Win32_PointingDevice
uint16 DeviceInterface
string HardwareType
uint8 NumberOfButtons
uint16 PointingType
uint32 Resolution
uint32 SampleRate
Win32_NetworkAdapter
string AdapterType
string MACAddress
uint64 MaxSpeed
string NetworkAddresses[]
string ServiceName
uint64 Speed
From Win32_NetworkAdapterConfiguration for the current adapter:
Win32_NetworkAdapterConfiguration
string DatabasePath
string DefaultIPGateway[]
boolean DHCPEnabled
datetime DHCPLeaseExpires
datetime DHCPLeaseObtained
string DHCPServer
string DNSDomain
boolean DNSEnabledForWINSResolution
string DNSHostName
string IPAddress[]
boolean IPEnabled
boolean IPFilterSecurityEnabled
boolean IPPortSecurityEnabled
string IPSubnet[]
boolean IPUseZeroBroadcast
string IPXAddress
boolean IPXEnabled
uint32 TcpipNetbiosOptions
uint32 TcpNumConnections
boolean WINSEnableLMHostsLookup
string WINSHostLookupFile
string WINSPrimaryServer
string WINSSecondaryServer
Win32_POTSModem
uint16 AnswerMode
string AttachedTo
string CountriesSupported[]
string DeviceType
uint16 DialType
string ModemInfPath
string PortSubClass
string Prefix
string ProviderName
uint8 RingsBeforeAnswer
string StringFormat
boolean SupportsCallback
datetime TimeOfLastReset
Win32_Printer
uint32 Attributes
boolean Network
string PortName
uint16 PrinterStatus
string PrintProcessor
string ServerName
From Win32_PrinterConfiguration for the current printer:
Win32_PrinterConfiguration
boolean Collate
uint32 Color
uint32 DitherType
uint32 DriverVersion
boolean Duplex
uint32 HorizontalResolution
uint32 VerticalResolution
uint32 ICMIntent
uint32 ICMMethod
uint32 MediaType
uint32 Orientation
string PaperSize
uint32 Scale
uint32 TTOption
Win32_Battery
uint32 BatteryRechargeTime
uint16 BatteryStatus
uint16 Chemistry
uint32 DesignCapacity
uint64 DesignVoltage
uint16 EstimatedChargeRemaining
uint32 EstimatedRunTime
uint32 ExpectedBatteryLife
uint32 ExpectedLife
uint32 FullChargeCapacity
uint32 MaxRechargeTime
uint32 TimeOnBattery
uint32 TimeToFullCharge
Win32_PortableBattery
The same properties as in Win32_Battery.
Win32_UninterruptiblePowerSupply
boolean BatteryInstalled
boolean CanTurnOffRemotely
uint32 FirstMessageDelay
boolean IsSwitchingSupply
boolean LowBatterySignal
uint32 MessageInterval
boolean PowerFailSignal
uint16 RemainingCapacityStatus
uint32 TimeOnBackup
uint32 TotalOutputPower
uint16 TypeOfRangeSwitching
string UPSPort
Win32_Fan
boolean ActiveCooling
boolean VariableSpeed
Win32_HeatPipe
Win32_Refrigeration
Win32_SystemEnclosure
boolean AudibleAlarm
string CableManagementStrategy
uint16 ChassisTypes[]
uint16 HeatGeneration
boolean LockPresent
uint16 NumberOfPowerCords
uint16 ServicePhilosophy[]
string Tag
boolean VisibleAlarm
Win32_ComputerSystem
string BootupStatev
string Domain
uint16 DomainRole
boolean InfraredSupported
uint32 NumberOfProcessors
boolean PowerManagementSupported
uint16 PowerState
uint16 PowerSupplyState
string SystemType
uint16 ThermalState
uint64 TotalPhysicalMemory
string UserName
uint16 WakeUpType
Win32_OperatingSystem
string BootDevice
string BuildNumber
string BuildType
string CodeSet
string CountryCode
sint16 CurrentTimeZone
boolean Distributed
uint8 ForegroundApplicationBoost
uint64 FreePhysicalMemoryv
uint64 FreeVirtualMemory
datetime LastBootUpTime
datetime LocalDateTime
string Locale
uint32 MaxNumberOfProcesses
uint32 NumberOfProcesses
uint32 NumberOfUsers
string Organization
uint32 OSLanguage
uint32 OSProductSuite
uint16 OSType
string RegisteredUser
uint16 ServicePackMajorVersion
uint16 ServicePackMinorVersion
string SystemDevice
string SystemDirectory
string WindowsDirectory
Win32_BootConfiguration
string BootDirectory
string ConfigurationPath
string ScratchDirectory
string SettingID
string TempDirectory
Win32_OSRecoveryConfiguration
boolean AutoReboot
string DebugFilePath
uint32 DebugInfoType
boolean OverwriteExistingDebugFile
boolean SendAdminAlert
boolean WriteDebugInfo
boolean WriteToSystemLog
Win32_QuickFixEngineering
string FixComments
string HotFixID
datetime InstallDate
string InstalledBy
string ServicePackInEffect
Win32_ODBCDataSourceSpecification
string CheckID
string DataSource
string DriverDescription
string Registration
Win32_ODBCDriverSpecification
string Driver
Win32_ODBCTranslatorSpecification
Win32_LocalTime
uint32 Day
uint32 DayOfWeek
uint32 Hour
uint32 Milliseconds
uint32 Minute
uint32 Month
uint32 Quarter
uint32 Second
uint32 WeekInMonth
uint32 Year
Win32_TimeZone
sint32 Bias
sint32 DaylightBias
string DaylightName
uint32 StandardBias
string StandardName
Win32_LogonSession
string AuthenticationPackage
string LogonId
uint32 LogonType
datetime StartTime
Win32_NetworkLoginProfile
datetime AccountExpires
uint32 AuthorizationFlags
uint32 BadPasswordCount
string Comment
string FullName
string HomeDirectory
string HomeDirectoryDrive
datetime LastLogoff
datetime LastLogon
string LogonHours
string LogonServer
uint64 MaximumStorage
uint32 NumberOfLogons
datetime PasswordAge
datetime PasswordExpires
uint32 PrimaryGroupId
uint32 Privileges
string Profile
string ScriptPath
uint32 UnitsPerWeek
uint32 UserId
string UserType
string Workstations
uint32 Flags
Win32_UserAccount
uint32 AccountType
boolean Disabled
boolean LocalAccount
boolean Lockout
boolean PasswordChangeable
boolean PasswordExpires
boolean PasswordRequired
Win32_Group
Win32_Product
string IdentifyingNumber
string InstallLocation
sint16 InstallState
string Vendor
Win32_NetworkProtocol
boolean ConnectionlessService
boolean GuaranteesDelivery
boolean GuaranteesSequencing
boolean MessageOriented
boolean SupportsBroadcasting
boolean SupportsConnectData
boolean SupportsDisconnectData
boolean SupportsEncryption
boolean SupportsExpeditedData
boolean SupportsFragmentation
boolean SupportsGracefulClosing
boolean SupportsGuaranteedBandwidth
boolean SupportsMulticasting
boolean SupportsQualityofService
uint32 ResponseTime
uint32 StatusCode
Win32_CodecFile
string Extension
There are several interesting articles on MSDN:
translate_date
translate_modem_port
PrintProcessor
PasswordAge
translate_pass_age
xmlAttachChildToParent
translate_processor_family
/username
/password
kerberos
_xml array
DOMDocument
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)
General News Suggestion Question Bug Answer Joke Rant Admin
Math Primers for Programmers