' ------------------------------------------------------------------------- ' From the book Inside Active Directory, ISBN 0-201-61621-1 ' Copyright (C) 2002 by Addison-Wesley ' Script by Sakari Kouti (see http://www.kouti.com) ' You have a royalty-free right to use, modify, reproduce and distribute ' this script (and/or any modified version) in any way you find useful, ' provided that you agree that Addison-Wesley or Sakari Kouti has no ' warranty, obligations or liability for the script. If you modify ' the script, you must retain this copyright notice. ' ------------------------------------------------------------------------- Option Explicit Dim objDSE, objSites, objChild, objChild2, strServersPath Dim objServers, objServer Set objDSE = GetObject("LDAP://rootDSE") Set objSites = GetObject("LDAP://CN=Sites," & _ objDSE.Get("configurationNamingContext")) For Each objChild In objSites If objChild.Class = "site" Then strServersPath = "LDAP://CN=Servers," & objChild.Name & _ ",CN=Sites," & objDSE.Get("configurationNamingContext") Set objServers = GetObject(strServersPath) For Each objServer In objServers For Each objChild2 In objServer If objChild2.Name = "CN=NTDS Settings" Then WScript.Echo objServer.Name & " " & objChild2.Guid & _ " " & objChild.Name End If Next Next End If Next