Contact Info

Crumbtrail

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

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


LogicalFile

Example(s)

$strComputer = "."

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

foreach ($obj in $objWmi)
{
	write-host "AccessMask:" $obj.AccessMask
	write-host "Archive:" $obj.Archive
	write-host "Caption:" $obj.Caption
	write-host "Compressed:" $obj.Compressed
	write-host "CompressionMethod:" $obj.CompressionMethod
	write-host "CreationClassName:" $obj.CreationClassName
	write-host "CreationDate:" $obj.CreationDate
	write-host "CSCreationClassName:" $obj.CSCreationClassName
	write-host "CSName:" $obj.CSName
	write-host "Description:" $obj.Description
	write-host "Drive:" $obj.Drive
	write-host "EightDotThreeFileName:" $obj.EightDotThreeFileName
	write-host "Encrypted:" $obj.Encrypted
	write-host "EncryptionMethod:" $obj.EncryptionMethod
	write-host "Extension:" $obj.Extension
	write-host "FileName:" $obj.FileName
	write-host "FileSize:" $obj.FileSize
	write-host "FileType:" $obj.FileType
	write-host "FSCreationClassName:" $obj.FSCreationClassName
	write-host "FSName:" $obj.FSName
	write-host "Hidden:" $obj.Hidden
	write-host "InstallDate:" $obj.InstallDate
	write-host "InUseCount:" $obj.InUseCount
	write-host "LastAccessed:" $obj.LastAccessed
	write-host "LastModified:" $obj.LastModified
	write-host "Name:" $obj.Name
	write-host "Path:" $obj.Path
	write-host "Readable:" $obj.Readable
	write-host "Status:" $obj.Status
	write-host "System:" $obj.System
	write-host "Writeable:" $obj.Writeable
	write-host
	write-host "########"
	write-host
}