Contact Info

Crumbtrail

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

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


Sample Code

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_PerfRawData_MSSQLSQLEXPRESS_MSSQLSQLEXPRESSGeneralStatistics",,48)
For Each objItem in colItems
    Wscript.Echo "ActiveTempTables: " & objItem.ActiveTempTables
    Wscript.Echo "Caption: " & objItem.Caption
    Wscript.Echo "ConnectionResetPersec: " & objItem.ConnectionResetPersec
    Wscript.Echo "Description: " & objItem.Description
    Wscript.Echo "EventNotificationsDelayedDrop: " & objItem.EventNotificationsDelayedDrop
    Wscript.Echo "Frequency_Object: " & objItem.Frequency_Object
    Wscript.Echo "Frequency_PerfTime: " & objItem.Frequency_PerfTime
    Wscript.Echo "Frequency_Sys100NS: " & objItem.Frequency_Sys100NS
    Wscript.Echo "HTTPAuthenticatedRequests: " & objItem.HTTPAuthenticatedRequests
    Wscript.Echo "LogicalConnections: " & objItem.LogicalConnections
    Wscript.Echo "LoginsPersec: " & objItem.LoginsPersec
    Wscript.Echo "LogoutsPersec: " & objItem.LogoutsPersec
    Wscript.Echo "MarsDeadlocks: " & objItem.MarsDeadlocks
    Wscript.Echo "Name: " & objItem.Name
    Wscript.Echo "Nonatomicyieldrate: " & objItem.Nonatomicyieldrate
    Wscript.Echo "Processesblocked: " & objItem.Processesblocked
    Wscript.Echo "SOAPEmptyRequests: " & objItem.SOAPEmptyRequests
    Wscript.Echo "SOAPMethodInvocations: " & objItem.SOAPMethodInvocations
    Wscript.Echo "SOAPSessionInitiateRequests: " & objItem.SOAPSessionInitiateRequests
    Wscript.Echo "SOAPSessionTerminateRequests: " & objItem.SOAPSessionTerminateRequests
    Wscript.Echo "SOAPSQLRequests: " & objItem.SOAPSQLRequests
    Wscript.Echo "SOAPWSDLRequests: " & objItem.SOAPWSDLRequests
    Wscript.Echo "SQLTraceIOProviderLockWaits: " & objItem.SQLTraceIOProviderLockWaits
    Wscript.Echo "Tempdbrecoveryunitid: " & objItem.Tempdbrecoveryunitid
    Wscript.Echo "Tempdbrowsetid: " & objItem.Tempdbrowsetid
    Wscript.Echo "TempTablesCreationRate: " & objItem.TempTablesCreationRate
    Wscript.Echo "TempTablesForDestruction: " & objItem.TempTablesForDestruction
    Wscript.Echo "Timestamp_Object: " & objItem.Timestamp_Object
    Wscript.Echo "Timestamp_PerfTime: " & objItem.Timestamp_PerfTime
    Wscript.Echo "Timestamp_Sys100NS: " & objItem.Timestamp_Sys100NS
    Wscript.Echo "TraceEventNotificationQueue: " & objItem.TraceEventNotificationQueue
    Wscript.Echo "Transactions: " & objItem.Transactions
    Wscript.Echo "UserConnections: " & objItem.UserConnections
Next