Contact Info

Crumbtrail

ActiveXperts.com » Administration » Scripts » WMI » powershell sample

Win32_PerfFormattedData_FileReplicaSet powershell sample code

The foundations for Manageability in Windows is 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. The Win32_PerfFormattedData_FileReplicaSet WMI class can be used in ActiveXperts Network Monitor to monitor your servers.


Sample Code

$strComputer = "."

$objWMi = get-wmiobject -computername localhost -Namespace root\CIMV2 -Query "Select * from Win32_PerfFormattedData_FileReplicaSet_FileReplicaSet"

foreach ($obj in $objWmi)
{
	write-host "Authentications:" $obj.Authentications
	write-host "AuthenticationsinError:" $obj.AuthenticationsinError
	write-host "Bindings:" $obj.Bindings
	write-host "BindingsinError:" $obj.BindingsinError
	write-host "BytesofFilesInstalled:" $obj.BytesofFilesInstalled
	write-host "BytesofStagingFetched:" $obj.BytesofStagingFetched
	write-host "BytesofStagingGenerated:" $obj.BytesofStagingGenerated
	write-host "BytesofStagingRegenerated:" $obj.BytesofStagingRegenerated
	write-host "Caption:" $obj.Caption
	write-host "ChangeOrdersAborted:" $obj.ChangeOrdersAborted
	write-host "ChangeOrdersEvaporated:" $obj.ChangeOrdersEvaporated
	write-host "ChangeOrdersIssued:" $obj.ChangeOrdersIssued
	write-host "ChangeOrdersMorphed:" $obj.ChangeOrdersMorphed
	write-host "ChangeOrdersPropagated:" $obj.ChangeOrdersPropagated
	write-host "ChangeOrdersReceived:" $obj.ChangeOrdersReceived
	write-host "ChangeOrdersRetired:" $obj.ChangeOrdersRetired
	write-host "ChangeOrdersRetried:" $obj.ChangeOrdersRetried
	write-host "ChangeOrdersRetriedatFetch:" $obj.ChangeOrdersRetriedatFetch
	write-host "ChangeOrdersRetriedatGenerate:" $obj.ChangeOrdersRetriedatGenerate
	write-host "ChangeOrdersRetriedatInstall:" $obj.ChangeOrdersRetriedatInstall
	write-host "ChangeOrdersRetriedatRename:" $obj.ChangeOrdersRetriedatRename
	write-host "ChangeOrdersSent:" $obj.ChangeOrdersSent
	write-host "CommunicationTimeouts:" $obj.CommunicationTimeouts
	write-host "Description:" $obj.Description
	write-host "DSBindings:" $obj.DSBindings
	write-host "DSBindingsinError:" $obj.DSBindingsinError
	write-host "DSObjects:" $obj.DSObjects
	write-host "DSObjectsinError:" $obj.DSObjectsinError
	write-host "DSPolls:" $obj.DSPolls
	write-host "DSPollswithChanges:" $obj.DSPollswithChanges
	write-host "DSPollswithoutChanges:" $obj.DSPollswithoutChanges
	write-host "DSSearches:" $obj.DSSearches
	write-host "DSSearchesinError:" $obj.DSSearchesinError
	write-host "FetchBlocksReceived:" $obj.FetchBlocksReceived
	write-host "FetchBlocksReceivedinBytes:" $obj.FetchBlocksReceivedinBytes
	write-host "FetchBlocksSent:" $obj.FetchBlocksSent
	write-host "FetchBlocksSentinBytes:" $obj.FetchBlocksSentinBytes
	write-host "FetchRequestsReceived:" $obj.FetchRequestsReceived
	write-host "FetchRequestsSent:" $obj.FetchRequestsSent
	write-host "FilesInstalled:" $obj.FilesInstalled
	write-host "FilesInstalledwithError:" $obj.FilesInstalledwithError
	write-host "Frequency_Object:" $obj.Frequency_Object
	write-host "Frequency_PerfTime:" $obj.Frequency_PerfTime
	write-host "Frequency_Sys100NS:" $obj.Frequency_Sys100NS
	write-host "InboundChangeOrdersDampened:" $obj.InboundChangeOrdersDampened
	write-host "JoinNotificationsReceived:" $obj.JoinNotificationsReceived
	write-host "JoinNotificationsSent:" $obj.JoinNotificationsSent
	write-host "Joins:" $obj.Joins
	write-host "KBofStagingSpaceFree:" $obj.KBofStagingSpaceFree
	write-host "KBofStagingSpaceInUse:" $obj.KBofStagingSpaceInUse
	write-host "LocalChangeOrdersAborted:" $obj.LocalChangeOrdersAborted
	write-host "LocalChangeOrdersIssued:" $obj.LocalChangeOrdersIssued
	write-host "LocalChangeOrdersMorphed:" $obj.LocalChangeOrdersMorphed
	write-host "LocalChangeOrdersPropagated:" $obj.LocalChangeOrdersPropagated
	write-host "LocalChangeOrdersRetired:" $obj.LocalChangeOrdersRetired
	write-host "LocalChangeOrdersRetried:" $obj.LocalChangeOrdersRetried
	write-host "LocalChangeOrdersRetriedatFetch:" $obj.LocalChangeOrdersRetriedatFetch
	write-host "LocalChangeOrdersRetriedatGenerate:" $obj.LocalChangeOrdersRetriedatGenerate
	write-host "LocalChangeOrdersRetriedatInstall:" $obj.LocalChangeOrdersRetriedatInstall
	write-host "LocalChangeOrdersRetriedatRename:" $obj.LocalChangeOrdersRetriedatRename
	write-host "LocalChangeOrdersSent:" $obj.LocalChangeOrdersSent
	write-host "LocalChangeOrdersSentAtJoin:" $obj.LocalChangeOrdersSentAtJoin
	write-host "Name:" $obj.Name
	write-host "OutboundChangeOrdersDampened:" $obj.OutboundChangeOrdersDampened
	write-host "PacketsReceived:" $obj.PacketsReceived
	write-host "PacketsReceivedinBytes:" $obj.PacketsReceivedinBytes
	write-host "PacketsReceivedinError:" $obj.PacketsReceivedinError
	write-host "PacketsSent:" $obj.PacketsSent
	write-host "PacketsSentinBytes:" $obj.PacketsSentinBytes
	write-host "PacketsSentinError:" $obj.PacketsSentinError
	write-host "RemoteChangeOrdersAborted:" $obj.RemoteChangeOrdersAborted
	write-host "RemoteChangeOrdersIssued:" $obj.RemoteChangeOrdersIssued
	write-host "RemoteChangeOrdersMorphed:" $obj.RemoteChangeOrdersMorphed
	write-host "RemoteChangeOrdersPropagated:" $obj.RemoteChangeOrdersPropagated
	write-host "RemoteChangeOrdersReceived:" $obj.RemoteChangeOrdersReceived
	write-host "RemoteChangeOrdersRetired:" $obj.RemoteChangeOrdersRetired
	write-host "RemoteChangeOrdersRetried:" $obj.RemoteChangeOrdersRetried
	write-host "RemoteChangeOrdersRetriedatFetch:" $obj.RemoteChangeOrdersRetriedatFetch
	write-host "RemoteChangeOrdersRetriedatGenerate:" $obj.RemoteChangeOrdersRetriedatGenerate
	write-host "RemoteChangeOrdersRetriedatInstall:" $obj.RemoteChangeOrdersRetriedatInstall
	write-host "RemoteChangeOrdersRetriedatRename:" $obj.RemoteChangeOrdersRetriedatRename
	write-host "RemoteChangeOrdersSent:" $obj.RemoteChangeOrdersSent
	write-host "ReplicaSetsCreated:" $obj.ReplicaSetsCreated
	write-host "ReplicaSetsDeleted:" $obj.ReplicaSetsDeleted
	write-host "ReplicaSetsRemoved:" $obj.ReplicaSetsRemoved
	write-host "ReplicaSetsStarted:" $obj.ReplicaSetsStarted
	write-host "StagingFilesFetched:" $obj.StagingFilesFetched
	write-host "StagingFilesGenerated:" $obj.StagingFilesGenerated
	write-host "StagingFilesGeneratedwithError:" $obj.StagingFilesGeneratedwithError
	write-host "StagingFilesRegenerated:" $obj.StagingFilesRegenerated
	write-host "Threadsexited:" $obj.Threadsexited
	write-host "Threadsstarted:" $obj.Threadsstarted
	write-host "Timestamp_Object:" $obj.Timestamp_Object
	write-host "Timestamp_PerfTime:" $obj.Timestamp_PerfTime
	write-host "Timestamp_Sys100NS:" $obj.Timestamp_Sys100NS
	write-host "Unjoins:" $obj.Unjoins
	write-host "UsnReads:" $obj.UsnReads
	write-host "UsnRecordsAccepted:" $obj.UsnRecordsAccepted
	write-host "UsnRecordsExamined:" $obj.UsnRecordsExamined
	write-host "UsnRecordsRejected:" $obj.UsnRecordsRejected
	write-host
	write-host "########"
	write-host
}