Contact Info

Crumbtrail

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

Win32_PerfFormattedData_WSIPPerf 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_WSIPPerf 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_WSIPPerf_LCSIP00Networking"

foreach ($obj in $objWmi)
{
	write-host "Caption:" $obj.Caption
	write-host "Description:" $obj.Description
	write-host "Frequency_Object:" $obj.Frequency_Object
	write-host "Frequency_PerfTime:" $obj.Frequency_PerfTime
	write-host "Frequency_Sys100NS:" $obj.Frequency_Sys100NS
	write-host "Name:" $obj.Name
	write-host "SIP000Sockets:" $obj.SIP000Sockets
	write-host "SIP001SocketsPersec:" $obj.SIP001SocketsPersec
	write-host "SIP002ConnectionsEstablished:" $obj.SIP002ConnectionsEstablished
	write-host "SIP003ConnectionsEstablishedPersec:" $obj.SIP003ConnectionsEstablishedPersec
	write-host "SIP004ConnectionsFailedToEstablish:" $obj.SIP004ConnectionsFailedToEstablish
	write-host "SIP005ConnectionsFailedToEstablishPerSec:" $obj.SIP005ConnectionsFailedToEstablishPerSec
	write-host "SIP006ConnectionsRefusedDueToServerOverload:" $obj.SIP006ConnectionsRefusedDueToServerOverload
	write-host "SIP007ConnectionsRefusedDueToServerOverloadPerSec:" $obj.SIP007ConnectionsRefusedDueToServerOverloadPerSec
	write-host "SIP008ConnectionsBeingEstablished:" $obj.SIP008ConnectionsBeingEstablished
	write-host "SIP009TLSNegotiationCompleted:" $obj.SIP009TLSNegotiationCompleted
	write-host "SIP010TLSNegotiationsCompletedPersec:" $obj.SIP010TLSNegotiationsCompletedPersec
	write-host "SIP011TLSNegotiationsFailed:" $obj.SIP011TLSNegotiationsFailed
	write-host "SIP012TLSNegotiationsFailedPersec:" $obj.SIP012TLSNegotiationsFailedPersec
	write-host "SIP013TLSConnectionsBeingNegotiated:" $obj.SIP013TLSConnectionsBeingNegotiated
	write-host "SIP014Uniqueusersconnecteddirectly:" $obj.SIP014Uniqueusersconnecteddirectly
	write-host "SIP015Connectionsaboveperuserlimitdropped:" $obj.SIP015Connectionsaboveperuserlimitdropped
	write-host "SIP016ConnectionsaboveperuserlimitdroppedPersec:" $obj.SIP016ConnectionsaboveperuserlimitdroppedPersec
	write-host "SIP017OutstandingAcceptOperations:" $obj.SIP017OutstandingAcceptOperations
	write-host "SIP018OutstandingReceiveOperations:" $obj.SIP018OutstandingReceiveOperations
	write-host "SIP019DNSqueriesresolvedviatheoperatingsystem:" $obj.SIP019DNSqueriesresolvedviatheoperatingsystem
	write-host "SIP020DNSqueriesqueuedforDNSresolution:" $obj.SIP020DNSqueriesqueuedforDNSresolution
	write-host "SIP021DNSqueriesbeingresolvedbytheoperatingsystem:" $obj.SIP021DNSqueriesbeingresolvedbytheoperatingsystem
	write-host "SIP022SuccessfulDNSqueries:" $obj.SIP022SuccessfulDNSqueries
	write-host "SIP023FailedDNSqueries:" $obj.SIP023FailedDNSqueries
	write-host "SIP024TimedoutDNSqueries:" $obj.SIP024TimedoutDNSqueries
	write-host "SIP025SuccessfulaccessestotheinternalDNScache:" $obj.SIP025SuccessfulaccessestotheinternalDNScache
	write-host "SIP026SuccessfulaccessestotheinternalDNScachepersecond:" $obj.SIP026SuccessfulaccessestotheinternalDNScachepersecond
	write-host "SIP027SuccessfulDNSqueryresultsintheinternalDNScache:" $obj.SIP027SuccessfulDNSqueryresultsintheinternalDNScache
	write-host "SIP028FailedDNSqueryresultsintheinternalDNScache:" $obj.SIP028FailedDNSqueryresultsintheinternalDNScache
	write-host "SIP029LastDNSquerytime:" $obj.SIP029LastDNSquerytime
	write-host "SIP030Numberoftimesnegativecacheentrieswereaccessed:" $obj.SIP030Numberoftimesnegativecacheentrieswereaccessed
	write-host "SIP031TimespentinmillisecondsdoingDNSqueries:" $obj.SIP031TimespentinmillisecondsdoingDNSqueries
	write-host "Timestamp_Object:" $obj.Timestamp_Object
	write-host "Timestamp_PerfTime:" $obj.Timestamp_PerfTime
	write-host "Timestamp_Sys100NS:" $obj.Timestamp_Sys100NS
	write-host
	write-host "########"
	write-host
}