Contact Info

Crumbtrail

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

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


Sample Code

from win32com.client import GetObject
objWMI = GetObject('winmgmts:').InstancesOf('Win32_PerfRawData_ADWS_ADWS')

for obj in objWMI:
	if obj.ActiveWebServiceSessions != None:
		print("ActiveWebServiceSessions:" + str(obj.ActiveWebServiceSessions))
	if obj.AllocatedConnections != None:
		print("AllocatedConnections:" + str(obj.AllocatedConnections))
	if obj.Caption != None:
		print("Caption:" + str(obj.Caption))
	if obj.ChangeOptionalFeatureOperationsPerSecond != None:
		print("ChangeOptionalFeatureOperationsPerSecond:" + str(obj.ChangeOptionalFeatureOperationsPerSecond))
	if obj.ChangePasswordOperationsPerSecond != None:
		print("ChangePasswordOperationsPerSecond:" + str(obj.ChangePasswordOperationsPerSecond))
	if obj.CreateOperationsPerSecond != None:
		print("CreateOperationsPerSecond:" + str(obj.CreateOperationsPerSecond))
	if obj.CustomActionCacheSize != None:
		print("CustomActionCacheSize:" + str(obj.CustomActionCacheSize))
	if obj.CustomActionDSRPCCacheConnectionCreationRate != None:
		print("CustomActionDSRPCCacheConnectionCreationRate:" + str(obj.CustomActionDSRPCCacheConnectionCreationRate))
	if obj.CustomActionDSRPCCacheConnectionReuseRate != None:
		print("CustomActionDSRPCCacheConnectionReuseRate:" + str(obj.CustomActionDSRPCCacheConnectionReuseRate))
	if obj.CustomActionDSRPCCacheMaximumPossibleSize != None:
		print("CustomActionDSRPCCacheMaximumPossibleSize:" + str(obj.CustomActionDSRPCCacheMaximumPossibleSize))
	if obj.CustomActionLDAPCacheConnectionCreationRate != None:
		print("CustomActionLDAPCacheConnectionCreationRate:" + str(obj.CustomActionLDAPCacheConnectionCreationRate))
	if obj.CustomActionLDAPCacheConnectionReuseRate != None:
		print("CustomActionLDAPCacheConnectionReuseRate:" + str(obj.CustomActionLDAPCacheConnectionReuseRate))
	if obj.CustomActionLDAPCacheMaximumPossibleSize != None:
		print("CustomActionLDAPCacheMaximumPossibleSize:" + str(obj.CustomActionLDAPCacheMaximumPossibleSize))
	if obj.DeleteOperationsPerSecond != None:
		print("DeleteOperationsPerSecond:" + str(obj.DeleteOperationsPerSecond))
	if obj.Description != None:
		print("Description:" + str(obj.Description))
	if obj.EnumerateOperationsPerSecond != None:
		print("EnumerateOperationsPerSecond:" + str(obj.EnumerateOperationsPerSecond))
	if obj.Frequency_Object != None:
		print("Frequency_Object:" + str(obj.Frequency_Object))
	if obj.Frequency_PerfTime != None:
		print("Frequency_PerfTime:" + str(obj.Frequency_PerfTime))
	if obj.Frequency_Sys100NS != None:
		print("Frequency_Sys100NS:" + str(obj.Frequency_Sys100NS))
	if obj.GetADDomainControllerOperationsPerSecond != None:
		print("GetADDomainControllerOperationsPerSecond:" + str(obj.GetADDomainControllerOperationsPerSecond))
	if obj.GetADDomainOperationsPerSecond != None:
		print("GetADDomainOperationsPerSecond:" + str(obj.GetADDomainOperationsPerSecond))
	if obj.GetADForestOperationsPerSecond != None:
		print("GetADForestOperationsPerSecond:" + str(obj.GetADForestOperationsPerSecond))
	if obj.GetADGroupMemberOperationsPerSecond != None:
		print("GetADGroupMemberOperationsPerSecond:" + str(obj.GetADGroupMemberOperationsPerSecond))
	if obj.GetADPrincipalAuthorizationGroupOperationsPerSecond != None:
		print("GetADPrincipalAuthorizationGroupOperationsPerSecond:" + str(obj.GetADPrincipalAuthorizationGroupOperationsPerSecond))
	if obj.GetADPrincipalGroupMembershipOperationsPerSecond != None:
		print("GetADPrincipalGroupMembershipOperationsPerSecond:" + str(obj.GetADPrincipalGroupMembershipOperationsPerSecond))
	if obj.GetOperationsPerSecond != None:
		print("GetOperationsPerSecond:" + str(obj.GetOperationsPerSecond))
	if obj.GetVersionOperationsPerSecond != None:
		print("GetVersionOperationsPerSecond:" + str(obj.GetVersionOperationsPerSecond))
	if obj.MoveADOperationMasterRoleOperationsPerSecond != None:
		print("MoveADOperationMasterRoleOperationsPerSecond:" + str(obj.MoveADOperationMasterRoleOperationsPerSecond))
	if obj.Name != None:
		print("Name:" + str(obj.Name))
	if obj.NonreservedConnectionsInUse != None:
		print("NonreservedConnectionsInUse:" + str(obj.NonreservedConnectionsInUse))
	if obj.NumberofDirectoryInstances != None:
		print("NumberofDirectoryInstances:" + str(obj.NumberofDirectoryInstances))
	if obj.OpenEnumerationContexts != None:
		print("OpenEnumerationContexts:" + str(obj.OpenEnumerationContexts))
	if obj.OpenWebServiceSessions != None:
		print("OpenWebServiceSessions:" + str(obj.OpenWebServiceSessions))
	if obj.PossibleConnections != None:
		print("PossibleConnections:" + str(obj.PossibleConnections))
	if obj.PullOperationsPerSecond != None:
		print("PullOperationsPerSecond:" + str(obj.PullOperationsPerSecond))
	if obj.PutOperationsPerSecond != None:
		print("PutOperationsPerSecond:" + str(obj.PutOperationsPerSecond))
	if obj.ReservedConnections != None:
		print("ReservedConnections:" + str(obj.ReservedConnections))
	if obj.ReservedConnectionsInUse != None:
		print("ReservedConnectionsInUse:" + str(obj.ReservedConnectionsInUse))
	if obj.SetPasswordOperationsPerSecond != None:
		print("SetPasswordOperationsPerSecond:" + str(obj.SetPasswordOperationsPerSecond))
	if obj.Timestamp_Object != None:
		print("Timestamp_Object:" + str(obj.Timestamp_Object))
	if obj.Timestamp_PerfTime != None:
		print("Timestamp_PerfTime:" + str(obj.Timestamp_PerfTime))
	if obj.Timestamp_Sys100NS != None:
		print("Timestamp_Sys100NS:" + str(obj.Timestamp_Sys100NS))
	if obj.TranslateNameOperationsPerSecond != None:
		print("TranslateNameOperationsPerSecond:" + str(obj.TranslateNameOperationsPerSecond))
	if obj.WebServiceSessionsCreatedPerSecond != None:
		print("WebServiceSessionsCreatedPerSecond:" + str(obj.WebServiceSessionsCreatedPerSecond))
	print("")
	print("########")
	print("")