Contact Info

Crumbtrail

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

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


Sample Code

Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select * From Win32_PerfRawData_IAS_NPSAccountingProxy")

For Each objItem in colItems
	WScript.Echo "AccountingRequests:" & objItem.AccountingRequests
	WScript.Echo "AccountingRequestsPersec:" & objItem.AccountingRequestsPersec
	WScript.Echo "AccountingResponses:" & objItem.AccountingResponses
	WScript.Echo "AccountingResponsesPersec:" & objItem.AccountingResponsesPersec
	WScript.Echo "BadAuthenticators:" & objItem.BadAuthenticators
	WScript.Echo "BadAuthenticatorsPersec:" & objItem.BadAuthenticatorsPersec
	WScript.Echo "Caption:" & objItem.Caption
	WScript.Echo "Description:" & objItem.Description
	WScript.Echo "DroppedPackets:" & objItem.DroppedPackets
	WScript.Echo "DroppedPacketsPersec:" & objItem.DroppedPacketsPersec
	WScript.Echo "Frequency_Object:" & objItem.Frequency_Object
	WScript.Echo "Frequency_PerfTime:" & objItem.Frequency_PerfTime
	WScript.Echo "Frequency_Sys100NS:" & objItem.Frequency_Sys100NS
	WScript.Echo "InvalidAddresses:" & objItem.InvalidAddresses
	WScript.Echo "InvalidAddressesPersec:" & objItem.InvalidAddressesPersec
	WScript.Echo "MalformedPackets:" & objItem.MalformedPackets
	WScript.Echo "MalformedPacketsPersec:" & objItem.MalformedPacketsPersec
	WScript.Echo "Name:" & objItem.Name
	WScript.Echo "PacketsReceived:" & objItem.PacketsReceived
	WScript.Echo "PacketsReceivedPersec:" & objItem.PacketsReceivedPersec
	WScript.Echo "PendingRequests:" & objItem.PendingRequests
	WScript.Echo "RequestTimeouts:" & objItem.RequestTimeouts
	WScript.Echo "RequestTimeoutsPersec:" & objItem.RequestTimeoutsPersec
	WScript.Echo "Retransmissions:" & objItem.Retransmissions
	WScript.Echo "RetransmissionsPersec:" & objItem.RetransmissionsPersec
	WScript.Echo "Timestamp_Object:" & objItem.Timestamp_Object
	WScript.Echo "Timestamp_PerfTime:" & objItem.Timestamp_PerfTime
	WScript.Echo "Timestamp_Sys100NS:" & objItem.Timestamp_Sys100NS
	WScript.Echo "UnknownType:" & objItem.UnknownType
	WScript.Echo "UnknownTypePersec:" & objItem.UnknownTypePersec
	WScript.Echo ""
	WScript.Echo "########"
	WScript.Echo ""
Next