Contact Info

Crumbtrail

ActiveXperts.com » Administration » Scripts » WMI Performance Counters » Powershell

StorageVolume - WMI sample in Powershell

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 StorageVolume WMI class can be used in ActiveXperts Network Monitor to monitor your servers.


StorageVolume

Example(s)

$strComputer = "."

$objWMi = get-wmiobject -computername localhost -Query "Select * from CIM_StorageVolume"

foreach ($obj in $objWmi)
{
	write-host "Access:" $obj.Access
	write-host "Automount:" $obj.Automount
	write-host "Availability:" $obj.Availability
	write-host "BlockSize:" $obj.BlockSize
	write-host "BootVolume:" $obj.BootVolume
	write-host "Capacity:" $obj.Capacity
	write-host "Caption:" $obj.Caption
	write-host "Compressed:" $obj.Compressed
	write-host "ConfigManagerErrorCode:" $obj.ConfigManagerErrorCode
	write-host "ConfigManagerUserConfig:" $obj.ConfigManagerUserConfig
	write-host "CreationClassName:" $obj.CreationClassName
	write-host "Description:" $obj.Description
	write-host "DeviceID:" $obj.DeviceID
	write-host "DirtyBitSet:" $obj.DirtyBitSet
	write-host "DriveLetter:" $obj.DriveLetter
	write-host "DriveType:" $obj.DriveType
	write-host "ErrorCleared:" $obj.ErrorCleared
	write-host "ErrorDescription:" $obj.ErrorDescription
	write-host "ErrorMethodology:" $obj.ErrorMethodology
	write-host "FileSystem:" $obj.FileSystem
	write-host "FreeSpace:" $obj.FreeSpace
	write-host "IndexingEnabled:" $obj.IndexingEnabled
	write-host "InstallDate:" $obj.InstallDate
	write-host "Label:" $obj.Label
	write-host "LastErrorCode:" $obj.LastErrorCode
	write-host "MaximumFileNameLength:" $obj.MaximumFileNameLength
	write-host "Name:" $obj.Name
	write-host "NumberOfBlocks:" $obj.NumberOfBlocks
	write-host "PageFilePresent:" $obj.PageFilePresent
	write-host "PNPDeviceID:" $obj.PNPDeviceID
	write-host "PowerManagementCapabilities:" $obj.PowerManagementCapabilities
	write-host "PowerManagementSupported:" $obj.PowerManagementSupported
	write-host "Purpose:" $obj.Purpose
	write-host "QuotasEnabled:" $obj.QuotasEnabled
	write-host "QuotasIncomplete:" $obj.QuotasIncomplete
	write-host "QuotasRebuilding:" $obj.QuotasRebuilding
	write-host "SerialNumber:" $obj.SerialNumber
	write-host "Status:" $obj.Status
	write-host "StatusInfo:" $obj.StatusInfo
	write-host "SupportsDiskQuotas:" $obj.SupportsDiskQuotas
	write-host "SupportsFileBasedCompression:" $obj.SupportsFileBasedCompression
	write-host "SystemCreationClassName:" $obj.SystemCreationClassName
	write-host "SystemName:" $obj.SystemName
	write-host "SystemVolume:" $obj.SystemVolume
	write-host
	write-host "########"
	write-host
}