Contact Info

Crumbtrail » Administration » Scripts » WMI Performance Counters » VBScript

StorageExtent - 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 StorageExtent 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_StorageExtent")

For Each objItem in colItems
	WScript.Echo "Access:" & objItem.Access
	WScript.Echo "AdditionalErrorData:" & objItem.AdditionalErrorData
	WScript.Echo "Availability:" & objItem.Availability
	WScript.Echo "BlockSize:" & objItem.BlockSize
	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 "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 "ErrorData:" & objItem.ErrorData
	WScript.Echo "ErrorDataOrder:" & objItem.ErrorDataOrder
	WScript.Echo "ErrorDescription:" & objItem.ErrorDescription
	WScript.Echo "ErrorGranularity:" & objItem.ErrorGranularity
	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 "InstallDate:" & objItem.InstallDate
	WScript.Echo "LastErrorCode:" & objItem.LastErrorCode
	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 "StartingAddress:" & objItem.StartingAddress
	WScript.Echo "Status:" & objItem.Status
	WScript.Echo "StatusInfo:" & objItem.StatusInfo
	WScript.Echo "SystemCreationClassName:" & objItem.SystemCreationClassName
	WScript.Echo "SystemLevelAddress:" & objItem.SystemLevelAddress
	WScript.Echo "SystemName:" & objItem.SystemName
	WScript.Echo ""
	WScript.Echo "########"
	WScript.Echo ""