Contact Info

Crumbtrail

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

Win32_PerfRawData_UGatherer 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_PerfRawData_UGatherer 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_PerfRawData_UGatherer_SearchGathererProjects"

foreach ($obj in $objWmi)
{
	write-host "AccessedFileRate:" $obj.AccessedFileRate
	write-host "AccessedFiles:" $obj.AccessedFiles
	write-host "AdaptiveCrawlErrors:" $obj.AdaptiveCrawlErrors
	write-host "Caption:" $obj.Caption
	write-host "ChangedDocuments:" $obj.ChangedDocuments
	write-host "Crawlsinprogress:" $obj.Crawlsinprogress
	write-host "DelayedDocuments:" $obj.DelayedDocuments
	write-host "Description:" $obj.Description
	write-host "DocumentAdditions:" $obj.DocumentAdditions
	write-host "DocumentAddRate:" $obj.DocumentAddRate
	write-host "DocumentDeleteRate:" $obj.DocumentDeleteRate
	write-host "DocumentDeletes:" $obj.DocumentDeletes
	write-host "DocumentModifies:" $obj.DocumentModifies
	write-host "DocumentModifiesRate:" $obj.DocumentModifiesRate
	write-host "DocumentMoveandRenameRate:" $obj.DocumentMoveandRenameRate
	write-host "DocumentMovesPerRenames:" $obj.DocumentMovesPerRenames
	write-host "DocumentsInProgress:" $obj.DocumentsInProgress
	write-host "DocumentsOnHold:" $obj.DocumentsOnHold
	write-host "ErrorRate:" $obj.ErrorRate
	write-host "FileErrors:" $obj.FileErrors
	write-host "FileErrorsRate:" $obj.FileErrorsRate
	write-host "FilteredOffice:" $obj.FilteredOffice
	write-host "FilteredOfficeRate:" $obj.FilteredOfficeRate
	write-host "FilteredText:" $obj.FilteredText
	write-host "FilteredTextRate:" $obj.FilteredTextRate
	write-host "FilteringDocuments:" $obj.FilteringDocuments
	write-host "Frequency_Object:" $obj.Frequency_Object
	write-host "Frequency_PerfTime:" $obj.Frequency_PerfTime
	write-host "Frequency_Sys100NS:" $obj.Frequency_Sys100NS
	write-host "GathererPausedFlag:" $obj.GathererPausedFlag
	write-host "HistoryRecoveryProgress:" $obj.HistoryRecoveryProgress
	write-host "IncrementalCrawls:" $obj.IncrementalCrawls
	write-host "IteratingHistoryInProgressFlag:" $obj.IteratingHistoryInProgressFlag
	write-host "Name:" $obj.Name
	write-host "NotModified:" $obj.NotModified
	write-host "ProcessedDocuments:" $obj.ProcessedDocuments
	write-host "ProcessedDocumentsRate:" $obj.ProcessedDocumentsRate
	write-host "RecoveryInProgressFlag:" $obj.RecoveryInProgressFlag
	write-host "Retries:" $obj.Retries
	write-host "RetriesRate:" $obj.RetriesRate
	write-host "StartedDocuments:" $obj.StartedDocuments
	write-host "StatusError:" $obj.StatusError
	write-host "StatusSuccess:" $obj.StatusSuccess
	write-host "SuccessRate:" $obj.SuccessRate
	write-host "Timestamp_Object:" $obj.Timestamp_Object
	write-host "Timestamp_PerfTime:" $obj.Timestamp_PerfTime
	write-host "Timestamp_Sys100NS:" $obj.Timestamp_Sys100NS
	write-host "UniqueDocuments:" $obj.UniqueDocuments
	write-host "URLsinHistory:" $obj.URLsinHistory
	write-host "WaitingDocuments:" $obj.WaitingDocuments
	write-host
	write-host "########"
	write-host
}