Contact Info

Crumbtrail » Administration » Scripts » WMI Performance Counters » VBScript

Memory - WMI sample in VBScript

The foundations for Manageability in Windows 2019/2012/2008/ and Windows 10/8/7/Vista/XP 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.

The Memory WMI class can be used in ActiveXperts Network Monitor to monitor your servers.



Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select * From CIM_Memory")

For Each objItem in colItems
	WScript.Echo "Access:" & objItem.Access
	WScript.Echo "AdditionalErrorData:" & objItem.AdditionalErrorData
	WScript.Echo "Associativity:" & objItem.Associativity
	WScript.Echo "Availability:" & objItem.Availability
	WScript.Echo "BlockSize:" & objItem.BlockSize
	WScript.Echo "CacheSpeed:" & objItem.CacheSpeed
	WScript.Echo "CacheType:" & objItem.CacheType
	WScript.Echo "Caption:" & objItem.Caption
	WScript.Echo "ConfigManagerErrorCode:" & objItem.ConfigManagerErrorCode
	WScript.Echo "ConfigManagerUserConfig:" & objItem.ConfigManagerUserConfig
	WScript.Echo "CorrectableError:" & objItem.CorrectableError
	WScript.Echo "CreationClassName:" & objItem.CreationClassName
	WScript.Echo "CurrentSRAM:" & objItem.CurrentSRAM
	WScript.Echo "Description:" & objItem.Description
	WScript.Echo "DeviceID:" & objItem.DeviceID
	WScript.Echo "EndingAddress:" & objItem.EndingAddress
	WScript.Echo "ErrorAccess:" & objItem.ErrorAccess
	WScript.Echo "ErrorAddress:" & objItem.ErrorAddress
	WScript.Echo "ErrorCleared:" & objItem.ErrorCleared
	WScript.Echo "ErrorCorrectType:" & objItem.ErrorCorrectType
	WScript.Echo "ErrorData:" & objItem.ErrorData
	WScript.Echo "ErrorDataOrder:" & objItem.ErrorDataOrder
	WScript.Echo "ErrorDescription:" & objItem.ErrorDescription
	WScript.Echo "ErrorInfo:" & objItem.ErrorInfo
	WScript.Echo "ErrorMethodology:" & objItem.ErrorMethodology
	WScript.Echo "ErrorResolution:" & objItem.ErrorResolution
	WScript.Echo "ErrorTime:" & objItem.ErrorTime
	WScript.Echo "ErrorTransferSize:" & objItem.ErrorTransferSize
	WScript.Echo "FlushTimer:" & objItem.FlushTimer
	WScript.Echo "InstallDate:" & objItem.InstallDate
	WScript.Echo "InstalledSize:" & objItem.InstalledSize
	WScript.Echo "LastErrorCode:" & objItem.LastErrorCode
	WScript.Echo "Level:" & objItem.Level
	WScript.Echo "LineSize:" & objItem.LineSize
	WScript.Echo "Location:" & objItem.Location
	WScript.Echo "MaxCacheSize:" & objItem.MaxCacheSize
	WScript.Echo "Name:" & objItem.Name
	WScript.Echo "NumberOfBlocks:" & objItem.NumberOfBlocks
	WScript.Echo "OtherErrorDescription:" & objItem.OtherErrorDescription
	WScript.Echo "PNPDeviceID:" & objItem.PNPDeviceID
	WScript.Echo "PowerManagementCapabilities:" & objItem.PowerManagementCapabilities
	WScript.Echo "PowerManagementSupported:" & objItem.PowerManagementSupported
	WScript.Echo "Purpose:" & objItem.Purpose
	WScript.Echo "ReadPolicy:" & objItem.ReadPolicy
	WScript.Echo "ReplacementPolicy:" & objItem.ReplacementPolicy
	WScript.Echo "StartingAddress:" & objItem.StartingAddress
	WScript.Echo "Status:" & objItem.Status
	WScript.Echo "StatusInfo:" & objItem.StatusInfo
	WScript.Echo "SupportedSRAM:" & objItem.SupportedSRAM
	WScript.Echo "SystemCreationClassName:" & objItem.SystemCreationClassName
	WScript.Echo "SystemLevelAddress:" & objItem.SystemLevelAddress
	WScript.Echo "SystemName:" & objItem.SystemName
	WScript.Echo "WritePolicy:" & objItem.WritePolicy
	WScript.Echo ""
	WScript.Echo "########"
	WScript.Echo ""