Contact Info

Crumbtrail

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

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


Description

The Win32_PerfRawData_W3SVC_WebService raw data performance counter class represents raw data counters specific to the World Wide Web Publishing Service. This class is found only on server operating systems. This class is shown as the WebService object in System Monitor. The WMI source of its data is the high-performance Performance Counter Provider. The original data source is the W3SVC performance library. The corresponding formatted data class is Win32_PerfFormattedData_W3SVC_WebService. This class was added for Windows 2000.

Sample Code

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_PerfRawData_W3SVC_WebService",,48)
For Each objItem in colItems
    Wscript.Echo "AnonymousUsersPersec: " & objItem.AnonymousUsersPersec
    Wscript.Echo "BytesReceivedPersec: " & objItem.BytesReceivedPersec
    Wscript.Echo "BytesSentPersec: " & objItem.BytesSentPersec
    Wscript.Echo "BytesTotalPersec: " & objItem.BytesTotalPersec
    Wscript.Echo "Caption: " & objItem.Caption
    Wscript.Echo "CGIRequestsPersec: " & objItem.CGIRequestsPersec
    Wscript.Echo "ConnectionAttemptsPersec: " & objItem.ConnectionAttemptsPersec
    Wscript.Echo "CopyRequestsPersec: " & objItem.CopyRequestsPersec
    Wscript.Echo "CurrentAnonymousUsers: " & objItem.CurrentAnonymousUsers
    Wscript.Echo "CurrentBlockedAsyncIPerORequests: " & objItem.CurrentBlockedAsyncIPerORequests
    Wscript.Echo "CurrentCALcountforauthenticatedusers: " & objItem.CurrentCALcountforauthenticatedusers
    Wscript.Echo "CurrentCALcountforSSLconnections: " & objItem.CurrentCALcountforSSLconnections
    Wscript.Echo "CurrentCGIRequests: " & objItem.CurrentCGIRequests
    Wscript.Echo "CurrentConnections: " & objItem.CurrentConnections
    Wscript.Echo "CurrentISAPIExtensionRequests: " & objItem.CurrentISAPIExtensionRequests
    Wscript.Echo "CurrentNonAnonymousUsers: " & objItem.CurrentNonAnonymousUsers
    Wscript.Echo "DeleteRequestsPersec: " & objItem.DeleteRequestsPersec
    Wscript.Echo "Description: " & objItem.Description
    Wscript.Echo "FilesPersec: " & objItem.FilesPersec
    Wscript.Echo "FilesReceivedPersec: " & objItem.FilesReceivedPersec
    Wscript.Echo "FilesSentPersec: " & objItem.FilesSentPersec
    Wscript.Echo "Frequency_Object: " & objItem.Frequency_Object
    Wscript.Echo "Frequency_PerfTime: " & objItem.Frequency_PerfTime
    Wscript.Echo "Frequency_Sys100NS: " & objItem.Frequency_Sys100NS
    Wscript.Echo "GetRequestsPersec: " & objItem.GetRequestsPersec
    Wscript.Echo "HeadRequestsPersec: " & objItem.HeadRequestsPersec
    Wscript.Echo "ISAPIExtensionRequestsPersec: " & objItem.ISAPIExtensionRequestsPersec
    Wscript.Echo "LockedErrorsPersec: " & objItem.LockedErrorsPersec
    Wscript.Echo "LockRequestsPersec: " & objItem.LockRequestsPersec
    Wscript.Echo "LogonAttemptsPersec: " & objItem.LogonAttemptsPersec
    Wscript.Echo "MaximumAnonymousUsers: " & objItem.MaximumAnonymousUsers
    Wscript.Echo "MaximumCALcountforauthenticatedusers: " & objItem.MaximumCALcountforauthenticatedusers
    Wscript.Echo "MaximumCALcountforSSLconnections: " & objItem.MaximumCALcountforSSLconnections
    Wscript.Echo "MaximumCGIRequests: " & objItem.MaximumCGIRequests
    Wscript.Echo "MaximumConnections: " & objItem.MaximumConnections
    Wscript.Echo "MaximumISAPIExtensionRequests: " & objItem.MaximumISAPIExtensionRequests
    Wscript.Echo "MaximumNonAnonymousUsers: " & objItem.MaximumNonAnonymousUsers
    Wscript.Echo "MeasuredAsyncIPerOBandwidthUsage: " & objItem.MeasuredAsyncIPerOBandwidthUsage
    Wscript.Echo "MkcolRequestsPersec: " & objItem.MkcolRequestsPersec
    Wscript.Echo "MoveRequestsPersec: " & objItem.MoveRequestsPersec
    Wscript.Echo "Name: " & objItem.Name
    Wscript.Echo "NonAnonymousUsersPersec: " & objItem.NonAnonymousUsersPersec
    Wscript.Echo "NotFoundErrorsPersec: " & objItem.NotFoundErrorsPersec
    Wscript.Echo "OptionsRequestsPersec: " & objItem.OptionsRequestsPersec
    Wscript.Echo "OtherRequestMethodsPersec: " & objItem.OtherRequestMethodsPersec
    Wscript.Echo "PostRequestsPersec: " & objItem.PostRequestsPersec
    Wscript.Echo "PropfindRequestsPersec: " & objItem.PropfindRequestsPersec
    Wscript.Echo "ProppatchRequestsPersec: " & objItem.ProppatchRequestsPersec
    Wscript.Echo "PutRequestsPersec: " & objItem.PutRequestsPersec
    Wscript.Echo "SearchRequestsPersec: " & objItem.SearchRequestsPersec
    Wscript.Echo "ServiceUptime: " & objItem.ServiceUptime
    Wscript.Echo "Timestamp_Object: " & objItem.Timestamp_Object
    Wscript.Echo "Timestamp_PerfTime: " & objItem.Timestamp_PerfTime
    Wscript.Echo "Timestamp_Sys100NS: " & objItem.Timestamp_Sys100NS
    Wscript.Echo "TotalAllowedAsyncIPerORequests: " & objItem.TotalAllowedAsyncIPerORequests
    Wscript.Echo "TotalAnonymousUsers: " & objItem.TotalAnonymousUsers
    Wscript.Echo "TotalBlockedAsyncIPerORequests: " & objItem.TotalBlockedAsyncIPerORequests
    Wscript.Echo "TotalCGIRequests: " & objItem.TotalCGIRequests
    Wscript.Echo "TotalConnectionAttemptsallinstances: " & objItem.TotalConnectionAttemptsallinstances
    Wscript.Echo "TotalCopyRequests: " & objItem.TotalCopyRequests
    Wscript.Echo "TotalcountoffailedCALrequestsforauthenticatedusers: " & objItem.TotalcountoffailedCALrequestsforauthenticatedusers
    Wscript.Echo "TotalcountoffailedCALrequestsforSSLconnections: " & objItem.TotalcountoffailedCALrequestsforSSLconnections
    Wscript.Echo "TotalDeleteRequests: " & objItem.TotalDeleteRequests
    Wscript.Echo "TotalFilesReceived: " & objItem.TotalFilesReceived
    Wscript.Echo "TotalFilesSent: " & objItem.TotalFilesSent
    Wscript.Echo "TotalFilesTransferred: " & objItem.TotalFilesTransferred
    Wscript.Echo "TotalGetRequests: " & objItem.TotalGetRequests
    Wscript.Echo "TotalHeadRequests: " & objItem.TotalHeadRequests
    Wscript.Echo "TotalISAPIExtensionRequests: " & objItem.TotalISAPIExtensionRequests
    Wscript.Echo "TotalLockedErrors: " & objItem.TotalLockedErrors
    Wscript.Echo "TotalLockRequests: " & objItem.TotalLockRequests
    Wscript.Echo "TotalLogonAttempts: " & objItem.TotalLogonAttempts
    Wscript.Echo "TotalMethodRequests: " & objItem.TotalMethodRequests
    Wscript.Echo "TotalMethodRequestsPersec: " & objItem.TotalMethodRequestsPersec
    Wscript.Echo "TotalMkcolRequests: " & objItem.TotalMkcolRequests
    Wscript.Echo "TotalMoveRequests: " & objItem.TotalMoveRequests
    Wscript.Echo "TotalNonAnonymousUsers: " & objItem.TotalNonAnonymousUsers
    Wscript.Echo "TotalNotFoundErrors: " & objItem.TotalNotFoundErrors
    Wscript.Echo "TotalOptionsRequests: " & objItem.TotalOptionsRequests
    Wscript.Echo "TotalOtherRequestMethods: " & objItem.TotalOtherRequestMethods
    Wscript.Echo "TotalPostRequests: " & objItem.TotalPostRequests
    Wscript.Echo "TotalPropfindRequests: " & objItem.TotalPropfindRequests
    Wscript.Echo "TotalProppatchRequests: " & objItem.TotalProppatchRequests
    Wscript.Echo "TotalPutRequests: " & objItem.TotalPutRequests
    Wscript.Echo "TotalRejectedAsyncIPerORequests: " & objItem.TotalRejectedAsyncIPerORequests
    Wscript.Echo "TotalSearchRequests: " & objItem.TotalSearchRequests
    Wscript.Echo "TotalTraceRequests: " & objItem.TotalTraceRequests
    Wscript.Echo "TotalUnlockRequests: " & objItem.TotalUnlockRequests
    Wscript.Echo "TraceRequestsPersec: " & objItem.TraceRequestsPersec
    Wscript.Echo "UnlockRequestsPersec: " & objItem.UnlockRequestsPersec
Next