Contact Info

Crumbtrail » Administration » Scripts » WMI Performance Counters » VBScript

MappedLogicalDisk - 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 MappedLogicalDisk 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 Win32_MappedLogicalDisk")

For Each objItem in colItems
	WScript.Echo "Access:" & objItem.Access
	WScript.Echo "Availability:" & objItem.Availability
	WScript.Echo "BlockSize:" & objItem.BlockSize
	WScript.Echo "Caption:" & objItem.Caption
	WScript.Echo "Compressed:" & objItem.Compressed
	WScript.Echo "ConfigManagerErrorCode:" & objItem.ConfigManagerErrorCode
	WScript.Echo "ConfigManagerUserConfig:" & objItem.ConfigManagerUserConfig
	WScript.Echo "CreationClassName:" & objItem.CreationClassName
	WScript.Echo "Description:" & objItem.Description
	WScript.Echo "DeviceID:" & objItem.DeviceID
	WScript.Echo "ErrorCleared:" & objItem.ErrorCleared
	WScript.Echo "ErrorDescription:" & objItem.ErrorDescription
	WScript.Echo "ErrorMethodology:" & objItem.ErrorMethodology
	WScript.Echo "FileSystem:" & objItem.FileSystem
	WScript.Echo "FreeSpace:" & objItem.FreeSpace
	WScript.Echo "InstallDate:" & objItem.InstallDate
	WScript.Echo "LastErrorCode:" & objItem.LastErrorCode
	WScript.Echo "MaximumComponentLength:" & objItem.MaximumComponentLength
	WScript.Echo "Name:" & objItem.Name
	WScript.Echo "NumberOfBlocks:" & objItem.NumberOfBlocks
	WScript.Echo "PNPDeviceID:" & objItem.PNPDeviceID
	WScript.Echo "PowerManagementCapabilities:" & Join(objItem.PowerManagementCapabilities)
	WScript.Echo "PowerManagementSupported:" & objItem.PowerManagementSupported
	WScript.Echo "ProviderName:" & objItem.ProviderName
	WScript.Echo "Purpose:" & objItem.Purpose
	WScript.Echo "QuotasDisabled:" & objItem.QuotasDisabled
	WScript.Echo "QuotasIncomplete:" & objItem.QuotasIncomplete
	WScript.Echo "QuotasRebuilding:" & objItem.QuotasRebuilding
	WScript.Echo "SessionID:" & objItem.SessionID
	WScript.Echo "Size:" & objItem.Size
	WScript.Echo "Status:" & objItem.Status
	WScript.Echo "StatusInfo:" & objItem.StatusInfo
	WScript.Echo "SupportsDiskQuotas:" & objItem.SupportsDiskQuotas
	WScript.Echo "SupportsFileBasedCompression:" & objItem.SupportsFileBasedCompression
	WScript.Echo "SystemCreationClassName:" & objItem.SystemCreationClassName
	WScript.Echo "SystemName:" & objItem.SystemName
	WScript.Echo "VolumeName:" & objItem.VolumeName
	WScript.Echo "VolumeSerialNumber:" & objItem.VolumeSerialNumber
	WScript.Echo ""
	WScript.Echo "########"
	WScript.Echo ""