Contact Info

Crumbtrail

ActiveXperts.com » Administration » Scripts » WMI Performance Counters » Perl

NTDS - WMI sample in Perl

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


NTDS

Example(s)

use Win32::OLE('in');

my $computer = ".";

my $objWMIService = Win32::OLE->GetObject("winmgmts:\\\\$computer\\root\\CIMV2") or die "WMI connection failed.\n";
my $colItems = $objWMIService->ExecQuery("SELECT * FROM Win32_PerfFormattedData_NTDS_NTDS", "WQL");

foreach my $objItem (in $colItems) {
	print "ABANRPersec: $objItem->{ABANRPersec}\n";
	print "ABBrowsesPersec: $objItem->{ABBrowsesPersec}\n";
	print "ABClientSessions: $objItem->{ABClientSessions}\n";
	print "ABMatchesPersec: $objItem->{ABMatchesPersec}\n";
	print "ABPropertyReadsPersec: $objItem->{ABPropertyReadsPersec}\n";
	print "ABProxyLookupsPersec: $objItem->{ABProxyLookupsPersec}\n";
	print "ABSearchesPersec: $objItem->{ABSearchesPersec}\n";
	print "ATQEstimatedQueueDelay: $objItem->{ATQEstimatedQueueDelay}\n";
	print "ATQOutstandingQueuedRequests: $objItem->{ATQOutstandingQueuedRequests}\n";
	print "ATQRequestLatency: $objItem->{ATQRequestLatency}\n";
	print "ATQThreadsLDAP: $objItem->{ATQThreadsLDAP}\n";
	print "ATQThreadsOther: $objItem->{ATQThreadsOther}\n";
	print "ATQThreadsTotal: $objItem->{ATQThreadsTotal}\n";
	print "BasesearchesPersec: $objItem->{BasesearchesPersec}\n";
	print "Caption: $objItem->{Caption}\n";
	print "DatabaseaddsPersec: $objItem->{DatabaseaddsPersec}\n";
	print "DatabasedeletesPersec: $objItem->{DatabasedeletesPersec}\n";
	print "DatabasemodifysPersec: $objItem->{DatabasemodifysPersec}\n";
	print "DatabaserecyclesPersec: $objItem->{DatabaserecyclesPersec}\n";
	print "Description: $objItem->{Description}\n";
	print "DigestBindsPersec: $objItem->{DigestBindsPersec}\n";
	print "DRAHighestUSNCommittedHighpart: $objItem->{DRAHighestUSNCommittedHighpart}\n";
	print "DRAHighestUSNCommittedLowpart: $objItem->{DRAHighestUSNCommittedLowpart}\n";
	print "DRAHighestUSNIssuedHighpart: $objItem->{DRAHighestUSNIssuedHighpart}\n";
	print "DRAHighestUSNIssuedLowpart: $objItem->{DRAHighestUSNIssuedLowpart}\n";
	print "DRAInboundBytesCompressedBetweenSitesAfterCompressionPersec: $objItem->{DRAInboundBytesCompressedBetweenSitesAfterCompressionPersec}\n";
	print "DRAInboundBytesCompressedBetweenSitesAfterCompressionSinceBoot: $objItem->{DRAInboundBytesCompressedBetweenSitesAfterCompressionSinceBoot}\n";
	print "DRAInboundBytesCompressedBetweenSitesBeforeCompressionPersec: $objItem->{DRAInboundBytesCompressedBetweenSitesBeforeCompressionPersec}\n";
	print "DRAInboundBytesCompressedBetweenSitesBeforeCompressionSinceBoot: $objItem->{DRAInboundBytesCompressedBetweenSitesBeforeCompressionSinceBoot}\n";
	print "DRAInboundBytesNotCompressedWithinSitePersec: $objItem->{DRAInboundBytesNotCompressedWithinSitePersec}\n";
	print "DRAInboundBytesNotCompressedWithinSiteSinceBoot: $objItem->{DRAInboundBytesNotCompressedWithinSiteSinceBoot}\n";
	print "DRAInboundBytesTotalPersec: $objItem->{DRAInboundBytesTotalPersec}\n";
	print "DRAInboundBytesTotalSinceBoot: $objItem->{DRAInboundBytesTotalSinceBoot}\n";
	print "DRAInboundFullSyncObjectsRemaining: $objItem->{DRAInboundFullSyncObjectsRemaining}\n";
	print "DRAInboundLinkValueUpdatesRemaininginPacket: $objItem->{DRAInboundLinkValueUpdatesRemaininginPacket}\n";
	print "DRAInboundObjectsAppliedPersec: $objItem->{DRAInboundObjectsAppliedPersec}\n";
	print "DRAInboundObjectsFilteredPersec: $objItem->{DRAInboundObjectsFilteredPersec}\n";
	print "DRAInboundObjectsPersec: $objItem->{DRAInboundObjectsPersec}\n";
	print "DRAInboundObjectUpdatesRemaininginPacket: $objItem->{DRAInboundObjectUpdatesRemaininginPacket}\n";
	print "DRAInboundPropertiesAppliedPersec: $objItem->{DRAInboundPropertiesAppliedPersec}\n";
	print "DRAInboundPropertiesFilteredPersec: $objItem->{DRAInboundPropertiesFilteredPersec}\n";
	print "DRAInboundPropertiesTotalPersec: $objItem->{DRAInboundPropertiesTotalPersec}\n";
	print "DRAInboundTotalUpdatesRemaininginPacket: $objItem->{DRAInboundTotalUpdatesRemaininginPacket}\n";
	print "DRAInboundValuesDNsonlyPersec: $objItem->{DRAInboundValuesDNsonlyPersec}\n";
	print "DRAInboundValuesTotalPersec: $objItem->{DRAInboundValuesTotalPersec}\n";
	print "DRAOutboundBytesCompressedBetweenSitesAfterCompressionPersec: $objItem->{DRAOutboundBytesCompressedBetweenSitesAfterCompressionPersec}\n";
	print "DRAOutboundBytesCompressedBetweenSitesAfterCompressionSinceBoot: $objItem->{DRAOutboundBytesCompressedBetweenSitesAfterCompressionSinceBoot}\n";
	print "DRAOutboundBytesCompressedBetweenSitesBeforeCompressionPersec: $objItem->{DRAOutboundBytesCompressedBetweenSitesBeforeCompressionPersec}\n";
	print "DRAOutboundBytesCompressedBetweenSitesBeforeCompressionSinceBoot: $objItem->{DRAOutboundBytesCompressedBetweenSitesBeforeCompressionSinceBoot}\n";
	print "DRAOutboundBytesNotCompressedWithinSitePersec: $objItem->{DRAOutboundBytesNotCompressedWithinSitePersec}\n";
	print "DRAOutboundBytesNotCompressedWithinSiteSinceBoot: $objItem->{DRAOutboundBytesNotCompressedWithinSiteSinceBoot}\n";
	print "DRAOutboundBytesTotalPersec: $objItem->{DRAOutboundBytesTotalPersec}\n";
	print "DRAOutboundBytesTotalSinceBoot: $objItem->{DRAOutboundBytesTotalSinceBoot}\n";
	print "DRAOutboundObjectsFilteredPersec: $objItem->{DRAOutboundObjectsFilteredPersec}\n";
	print "DRAOutboundObjectsPersec: $objItem->{DRAOutboundObjectsPersec}\n";
	print "DRAOutboundPropertiesPersec: $objItem->{DRAOutboundPropertiesPersec}\n";
	print "DRAOutboundValuesDNsonlyPersec: $objItem->{DRAOutboundValuesDNsonlyPersec}\n";
	print "DRAOutboundValuesTotalPersec: $objItem->{DRAOutboundValuesTotalPersec}\n";
	print "DRAPendingReplicationOperations: $objItem->{DRAPendingReplicationOperations}\n";
	print "DRAPendingReplicationSynchronizations: $objItem->{DRAPendingReplicationSynchronizations}\n";
	print "DRASyncFailuresonSchemaMismatch: $objItem->{DRASyncFailuresonSchemaMismatch}\n";
	print "DRASyncRequestsMade: $objItem->{DRASyncRequestsMade}\n";
	print "DRASyncRequestsSuccessful: $objItem->{DRASyncRequestsSuccessful}\n";
	print "DRAThreadsGettingNCChanges: $objItem->{DRAThreadsGettingNCChanges}\n";
	print "DRAThreadsGettingNCChangesHoldingSemaphore: $objItem->{DRAThreadsGettingNCChangesHoldingSemaphore}\n";
	print "DSClientBindsPersec: $objItem->{DSClientBindsPersec}\n";
	print "DSClientNameTranslationsPersec: $objItem->{DSClientNameTranslationsPersec}\n";
	print "DSDirectoryReadsPersec: $objItem->{DSDirectoryReadsPersec}\n";
	print "DSDirectorySearchesPersec: $objItem->{DSDirectorySearchesPersec}\n";
	print "DSDirectoryWritesPersec: $objItem->{DSDirectoryWritesPersec}\n";
	print "DSMonitorListSize: $objItem->{DSMonitorListSize}\n";
	print "DSNameCachehitrate: $objItem->{DSNameCachehitrate}\n";
	print "DSNotifyQueueSize: $objItem->{DSNotifyQueueSize}\n";
	print "DSPercentReadsfromDRA: $objItem->{DSPercentReadsfromDRA}\n";
	print "DSPercentReadsfromKCC: $objItem->{DSPercentReadsfromKCC}\n";
	print "DSPercentReadsfromLSA: $objItem->{DSPercentReadsfromLSA}\n";
	print "DSPercentReadsfromNSPI: $objItem->{DSPercentReadsfromNSPI}\n";
	print "DSPercentReadsfromNTDSAPI: $objItem->{DSPercentReadsfromNTDSAPI}\n";
	print "DSPercentReadsfromSAM: $objItem->{DSPercentReadsfromSAM}\n";
	print "DSPercentReadsOther: $objItem->{DSPercentReadsOther}\n";
	print "DSPercentSearchesfromDRA: $objItem->{DSPercentSearchesfromDRA}\n";
	print "DSPercentSearchesfromKCC: $objItem->{DSPercentSearchesfromKCC}\n";
	print "DSPercentSearchesfromLDAP: $objItem->{DSPercentSearchesfromLDAP}\n";
	print "DSPercentSearchesfromLSA: $objItem->{DSPercentSearchesfromLSA}\n";
	print "DSPercentSearchesfromNSPI: $objItem->{DSPercentSearchesfromNSPI}\n";
	print "DSPercentSearchesfromNTDSAPI: $objItem->{DSPercentSearchesfromNTDSAPI}\n";
	print "DSPercentSearchesfromSAM: $objItem->{DSPercentSearchesfromSAM}\n";
	print "DSPercentSearchesOther: $objItem->{DSPercentSearchesOther}\n";
	print "DSPercentWritesfromDRA: $objItem->{DSPercentWritesfromDRA}\n";
	print "DSPercentWritesfromKCC: $objItem->{DSPercentWritesfromKCC}\n";
	print "DSPercentWritesfromLDAP: $objItem->{DSPercentWritesfromLDAP}\n";
	print "DSPercentWritesfromLSA: $objItem->{DSPercentWritesfromLSA}\n";
	print "DSPercentWritesfromNSPI: $objItem->{DSPercentWritesfromNSPI}\n";
	print "DSPercentWritesfromNTDSAPI: $objItem->{DSPercentWritesfromNTDSAPI}\n";
	print "DSPercentWritesfromSAM: $objItem->{DSPercentWritesfromSAM}\n";
	print "DSPercentWritesOther: $objItem->{DSPercentWritesOther}\n";
	print "DSSearchsuboperationsPersec: $objItem->{DSSearchsuboperationsPersec}\n";
	print "DSSecurityDescriptorPropagationsEvents: $objItem->{DSSecurityDescriptorPropagationsEvents}\n";
	print "DSSecurityDescriptorPropagatorAverageExclusionTime: $objItem->{DSSecurityDescriptorPropagatorAverageExclusionTime}\n";
	print "DSSecurityDescriptorPropagatorRuntimeQueue: $objItem->{DSSecurityDescriptorPropagatorRuntimeQueue}\n";
	print "DSSecurityDescriptorsuboperationsPersec: $objItem->{DSSecurityDescriptorsuboperationsPersec}\n";
	print "DSServerBindsPersec: $objItem->{DSServerBindsPersec}\n";
	print "DSServerNameTranslationsPersec: $objItem->{DSServerNameTranslationsPersec}\n";
	print "DSThreadsinUse: $objItem->{DSThreadsinUse}\n";
	print "ExternalBindsPersec: $objItem->{ExternalBindsPersec}\n";
	print "FastBindsPersec: $objItem->{FastBindsPersec}\n";
	print "Frequency_Object: $objItem->{Frequency_Object}\n";
	print "Frequency_PerfTime: $objItem->{Frequency_PerfTime}\n";
	print "Frequency_Sys100NS: $objItem->{Frequency_Sys100NS}\n";
	print "LDAPActiveThreads: $objItem->{LDAPActiveThreads}\n";
	print "LDAPBindTime: $objItem->{LDAPBindTime}\n";
	print "LDAPClientSessions: $objItem->{LDAPClientSessions}\n";
	print "LDAPClosedConnectionsPersec: $objItem->{LDAPClosedConnectionsPersec}\n";
	print "LDAPNewConnectionsPersec: $objItem->{LDAPNewConnectionsPersec}\n";
	print "LDAPNewSSLConnectionsPersec: $objItem->{LDAPNewSSLConnectionsPersec}\n";
	print "LDAPSearchesPersec: $objItem->{LDAPSearchesPersec}\n";
	print "LDAPSuccessfulBindsPersec: $objItem->{LDAPSuccessfulBindsPersec}\n";
	print "LDAPUDPoperationsPersec: $objItem->{LDAPUDPoperationsPersec}\n";
	print "LDAPWritesPersec: $objItem->{LDAPWritesPersec}\n";
	print "LinkValuesCleanedPersec: $objItem->{LinkValuesCleanedPersec}\n";
	print "Name: $objItem->{Name}\n";
	print "NegotiatedBindsPersec: $objItem->{NegotiatedBindsPersec}\n";
	print "NTLMBindsPersec: $objItem->{NTLMBindsPersec}\n";
	print "OnelevelsearchesPersec: $objItem->{OnelevelsearchesPersec}\n";
	print "PhantomsCleanedPersec: $objItem->{PhantomsCleanedPersec}\n";
	print "PhantomsVisitedPersec: $objItem->{PhantomsVisitedPersec}\n";
	print "SAMAccountGroupEvaluationLatency: $objItem->{SAMAccountGroupEvaluationLatency}\n";
	print "SAMDisplayInformationQueriesPersec: $objItem->{SAMDisplayInformationQueriesPersec}\n";
	print "SAMDomainLocalGroupMembershipEvaluationsPersec: $objItem->{SAMDomainLocalGroupMembershipEvaluationsPersec}\n";
	print "SAMEnumerationsPersec: $objItem->{SAMEnumerationsPersec}\n";
	print "SAMGCEvaluationsPersec: $objItem->{SAMGCEvaluationsPersec}\n";
	print "SAMGlobalGroupMembershipEvaluationsPersec: $objItem->{SAMGlobalGroupMembershipEvaluationsPersec}\n";
	print "SAMMachineCreationAttemptsPersec: $objItem->{SAMMachineCreationAttemptsPersec}\n";
	print "SAMMembershipChangesPersec: $objItem->{SAMMembershipChangesPersec}\n";
	print "SAMNonTransitiveMembershipEvaluationsPersec: $objItem->{SAMNonTransitiveMembershipEvaluationsPersec}\n";
	print "SAMPasswordChangesPersec: $objItem->{SAMPasswordChangesPersec}\n";
	print "SAMResourceGroupEvaluationLatency: $objItem->{SAMResourceGroupEvaluationLatency}\n";
	print "SAMSuccessfulComputerCreationsPersecIncludesallrequests: $objItem->{SAMSuccessfulComputerCreationsPersecIncludesallrequests}\n";
	print "SAMSuccessfulUserCreationsPersec: $objItem->{SAMSuccessfulUserCreationsPersec}\n";
	print "SAMTransitiveMembershipEvaluationsPersec: $objItem->{SAMTransitiveMembershipEvaluationsPersec}\n";
	print "SAMUniversalGroupMembershipEvaluationsPersec: $objItem->{SAMUniversalGroupMembershipEvaluationsPersec}\n";
	print "SAMUserCreationAttemptsPersec: $objItem->{SAMUserCreationAttemptsPersec}\n";
	print "SimpleBindsPersec: $objItem->{SimpleBindsPersec}\n";
	print "SubtreesearchesPersec: $objItem->{SubtreesearchesPersec}\n";
	print "Timestamp_Object: $objItem->{Timestamp_Object}\n";
	print "Timestamp_PerfTime: $objItem->{Timestamp_PerfTime}\n";
	print "Timestamp_Sys100NS: $objItem->{Timestamp_Sys100NS}\n";
	print "TombstonesGarbageCollectedPersec: $objItem->{TombstonesGarbageCollectedPersec}\n";
	print "TombstonesVisitedPersec: $objItem->{TombstonesVisitedPersec}\n";
	print "\n";
	print "########\n";
	print "\n";
}