var wbemFlagReturnImmediately = 0x10; var wbemFlagForwardOnly = 0x20; var arrComputers = new Array("."); for (i = 0; i < arrComputers.length; i++) { WScript.Echo(); WScript.Echo("=========================================="); WScript.Echo("Computer: " + arrComputers[i]); WScript.Echo("=========================================="); var objWMIService = GetObject("winmgmts:\\\\" + arrComputers[i] + "\\root\\directory\\LDAP"); var colItems = objWMIService.ExecQuery("SELECT * FROM RootDSE", "WQL", wbemFlagReturnImmediately | wbemFlagForwardOnly); var enumItems = new Enumerator(colItems); for (; !enumItems.atEnd(); enumItems.moveNext()) { var objItem = enumItems.item(); WScript.Echo("configurationNamingContext: " + objItem.configurationNamingContext); WScript.Echo("currentTime: " + objItem.currentTime); WScript.Echo("defaultNamingContext: " + objItem.defaultNamingContext); WScript.Echo("dnsHostName: " + objItem.dnsHostName); WScript.Echo("dsServiceName: " + objItem.dsServiceName); WScript.Echo("highestCommittedUSN: " + objItem.highestCommittedUSN); WScript.Echo("LDAPServiceName: " + objItem.LDAPServiceName); try { WScript.Echo("namingContexts: " + (objItem.namingContexts.toArray()).join(",")); } catch(e) { WScript.Echo("namingContexts: null"); } WScript.Echo("rootDomainNamingContext: " + objItem.rootDomainNamingContext); WScript.Echo("schemaNamingContext: " + objItem.schemaNamingContext); WScript.Echo("serverName: " + objItem.serverName); WScript.Echo("subschemaSubentry: " + objItem.subschemaSubentry); WScript.Echo("supportedCapabilities: " + objItem.supportedCapabilities); try { WScript.Echo("supportedControl: " + (objItem.supportedControl.toArray()).join(",")); } catch(e) { WScript.Echo("supportedControl: null"); } try { WScript.Echo("supportedLDAPPolicies: " + (objItem.supportedLDAPPolicies.toArray()).join(",")); } catch(e) { WScript.Echo("supportedLDAPPolicies: null"); } try { WScript.Echo("supportedLDAPVersion: " + (objItem.supportedLDAPVersion.toArray()).join(",")); } catch(e) { WScript.Echo("supportedLDAPVersion: null"); } try { WScript.Echo("supportedSASLMechanisms: " + (objItem.supportedSASLMechanisms.toArray()).join(",")); } catch(e) { WScript.Echo("supportedSASLMechanisms: null"); } } }