Contact Info

Crumbtrail » Administration » Scripts » WMI Performance Counters » VBScript

Service - WMI sample in VBScript

The foundations for Manageability in Windows 2019/2012/2008/ and Windows 10/8/7/Vista/XP are 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.

On this site, you can find many WMI samples.

The Service WMI class can be used in ActiveXperts Network Monitor to monitor your servers.



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

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

For Each objItem in colItems
	WScript.Echo "AccessLoggingEnabled:" & objItem.AccessLoggingEnabled
	WScript.Echo "AdjustRepositoriesRootPermissions:" & objItem.AdjustRepositoriesRootPermissions
	WScript.Echo "AuthType:" & objItem.AuthType
	WScript.Echo "CustomServerName:" & objItem.CustomServerName
	WScript.Echo "ExitCode:" & objItem.ExitCode
	WScript.Echo "ListenAllIPAddresses:" & objItem.ListenAllIPAddresses
	WScript.Echo "ListenIPAddressesArray:" & Join(objItem.ListenIPAddressesArray)
	WScript.Echo "Name:" & objItem.Name
	WScript.Echo "OperationalLoggingEnabled:" & objItem.OperationalLoggingEnabled
	WScript.Echo "RepositoriesRoot:" & objItem.RepositoriesRoot
	WScript.Echo "SecurePort:" & objItem.SecurePort
	WScript.Echo "ServerName:" & objItem.ServerName
	WScript.Echo "ServiceState:" & objItem.ServiceState
	WScript.Echo "UnsecurePort:" & objItem.UnsecurePort
	WScript.Echo "URL:" & objItem.URL
	WScript.Echo "UseCustomServerName:" & objItem.UseCustomServerName
	WScript.Echo "UseSecureConnection:" & objItem.UseSecureConnection
	WScript.Echo "UseUPNFormat:" & objItem.UseUPNFormat
	WScript.Echo ""
	WScript.Echo "########"
	WScript.Echo ""