Contact Info

Crumbtrail

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

Win32_PerfRawData_ASPNET2050727 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_ASPNET2050727 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_ASPNET2050727_ASPNETAppsv2050727"

foreach ($obj in $objWmi)
{
	write-host "AnonymousRequests:" $obj.AnonymousRequests
	write-host "AnonymousRequestsPerSec:" $obj.AnonymousRequestsPerSec
	write-host "ApplicationLifetimeEvents:" $obj.ApplicationLifetimeEvents
	write-host "ApplicationLifetimeEventsPerSec:" $obj.ApplicationLifetimeEventsPerSec
	write-host "AuditFailureEventsRaised:" $obj.AuditFailureEventsRaised
	write-host "AuditSuccessEventsRaised:" $obj.AuditSuccessEventsRaised
	write-host "CacheAPIEntries:" $obj.CacheAPIEntries
	write-host "CacheAPIHitRatio:" $obj.CacheAPIHitRatio
	write-host "CacheAPIHitRatio_Base:" $obj.CacheAPIHitRatio_Base
	write-host "CacheAPIHits:" $obj.CacheAPIHits
	write-host "CacheAPIMisses:" $obj.CacheAPIMisses
	write-host "CacheAPITrims:" $obj.CacheAPITrims
	write-host "CacheAPITurnoverRate:" $obj.CacheAPITurnoverRate
	write-host "CachePercentMachineMemoryLimitUsed:" $obj.CachePercentMachineMemoryLimitUsed
	write-host "CachePercentMachineMemoryLimitUsed_Base:" $obj.CachePercentMachineMemoryLimitUsed_Base
	write-host "CachePercentProcessMemoryLimitUsed:" $obj.CachePercentProcessMemoryLimitUsed
	write-host "CachePercentProcessMemoryLimitUsed_Base:" $obj.CachePercentProcessMemoryLimitUsed_Base
	write-host "CacheTotalEntries:" $obj.CacheTotalEntries
	write-host "CacheTotalHitRatio:" $obj.CacheTotalHitRatio
	write-host "CacheTotalHitRatio_Base:" $obj.CacheTotalHitRatio_Base
	write-host "CacheTotalHits:" $obj.CacheTotalHits
	write-host "CacheTotalMisses:" $obj.CacheTotalMisses
	write-host "CacheTotalTrims:" $obj.CacheTotalTrims
	write-host "CacheTotalTurnoverRate:" $obj.CacheTotalTurnoverRate
	write-host "Caption:" $obj.Caption
	write-host "CompilationsTotal:" $obj.CompilationsTotal
	write-host "DebuggingRequests:" $obj.DebuggingRequests
	write-host "Description:" $obj.Description
	write-host "ErrorEventsRaised:" $obj.ErrorEventsRaised
	write-host "ErrorEventsRaisedPerSec:" $obj.ErrorEventsRaisedPerSec
	write-host "ErrorsDuringCompilation:" $obj.ErrorsDuringCompilation
	write-host "ErrorsDuringExecution:" $obj.ErrorsDuringExecution
	write-host "ErrorsDuringPreprocessing:" $obj.ErrorsDuringPreprocessing
	write-host "ErrorsTotal:" $obj.ErrorsTotal
	write-host "ErrorsTotalPerSec:" $obj.ErrorsTotalPerSec
	write-host "ErrorsUnhandledDuringExecution:" $obj.ErrorsUnhandledDuringExecution
	write-host "ErrorsUnhandledDuringExecutionPerSec:" $obj.ErrorsUnhandledDuringExecutionPerSec
	write-host "EventsRaised:" $obj.EventsRaised
	write-host "EventsRaisedPerSec:" $obj.EventsRaisedPerSec
	write-host "FormsAuthenticationFailure:" $obj.FormsAuthenticationFailure
	write-host "FormsAuthenticationSuccess:" $obj.FormsAuthenticationSuccess
	write-host "Frequency_Object:" $obj.Frequency_Object
	write-host "Frequency_PerfTime:" $obj.Frequency_PerfTime
	write-host "Frequency_Sys100NS:" $obj.Frequency_Sys100NS
	write-host "InfrastructureErrorEventsRaised:" $obj.InfrastructureErrorEventsRaised
	write-host "InfrastructureErrorEventsRaisedPerSec:" $obj.InfrastructureErrorEventsRaisedPerSec
	write-host "MembershipAuthenticationFailure:" $obj.MembershipAuthenticationFailure
	write-host "MembershipAuthenticationSuccess:" $obj.MembershipAuthenticationSuccess
	write-host "Name:" $obj.Name
	write-host "OutputCacheEntries:" $obj.OutputCacheEntries
	write-host "OutputCacheHitRatio:" $obj.OutputCacheHitRatio
	write-host "OutputCacheHitRatio_Base:" $obj.OutputCacheHitRatio_Base
	write-host "OutputCacheHits:" $obj.OutputCacheHits
	write-host "OutputCacheMisses:" $obj.OutputCacheMisses
	write-host "OutputCacheTrims:" $obj.OutputCacheTrims
	write-host "OutputCacheTurnoverRate:" $obj.OutputCacheTurnoverRate
	write-host "PipelineInstanceCount:" $obj.PipelineInstanceCount
	write-host "RequestBytesInTotal:" $obj.RequestBytesInTotal
	write-host "RequestBytesOutTotal:" $obj.RequestBytesOutTotal
	write-host "RequestErrorEventsRaised:" $obj.RequestErrorEventsRaised
	write-host "RequestErrorEventsRaisedPerSec:" $obj.RequestErrorEventsRaisedPerSec
	write-host "RequestEventsRaised:" $obj.RequestEventsRaised
	write-host "RequestEventsRaisedPerSec:" $obj.RequestEventsRaisedPerSec
	write-host "RequestExecutionTime:" $obj.RequestExecutionTime
	write-host "RequestsDisconnected:" $obj.RequestsDisconnected
	write-host "RequestsExecuting:" $obj.RequestsExecuting
	write-host "RequestsFailed:" $obj.RequestsFailed
	write-host "RequestsInApplicationQueue:" $obj.RequestsInApplicationQueue
	write-host "RequestsNotAuthorized:" $obj.RequestsNotAuthorized
	write-host "RequestsNotFound:" $obj.RequestsNotFound
	write-host "RequestsPerSec:" $obj.RequestsPerSec
	write-host "RequestsRejected:" $obj.RequestsRejected
	write-host "RequestsSucceeded:" $obj.RequestsSucceeded
	write-host "RequestsTimedOut:" $obj.RequestsTimedOut
	write-host "RequestsTotal:" $obj.RequestsTotal
	write-host "RequestWaitTime:" $obj.RequestWaitTime
	write-host "SessionsAbandoned:" $obj.SessionsAbandoned
	write-host "SessionsActive:" $obj.SessionsActive
	write-host "SessionSQLServerconnectionstotal:" $obj.SessionSQLServerconnectionstotal
	write-host "SessionStateServerconnectionstotal:" $obj.SessionStateServerconnectionstotal
	write-host "SessionsTimedOut:" $obj.SessionsTimedOut
	write-host "SessionsTotal:" $obj.SessionsTotal
	write-host "Timestamp_Object:" $obj.Timestamp_Object
	write-host "Timestamp_PerfTime:" $obj.Timestamp_PerfTime
	write-host "Timestamp_Sys100NS:" $obj.Timestamp_Sys100NS
	write-host "TransactionsAborted:" $obj.TransactionsAborted
	write-host "TransactionsCommitted:" $obj.TransactionsCommitted
	write-host "TransactionsPending:" $obj.TransactionsPending
	write-host "TransactionsPerSec:" $obj.TransactionsPerSec
	write-host "TransactionsTotal:" $obj.TransactionsTotal
	write-host "ViewstateMACValidationFailure:" $obj.ViewstateMACValidationFailure
	write-host
	write-host "########"
	write-host
}