[ Team LiB ] |
Recipe 17.4 Finding the Replica Servers for an Application Partition17.4.1 ProblemYou want to find the replica servers for an application partition. 17.4.2 Solution17.4.2.1 Using a graphical user interface
17.4.2.2 Using a command-line interface> ntdsutil "dom man" conn "co to se <DomainControllerName>" q "list nc replicas[RETURN]
<AppPartitionDN>" q q
17.4.2.3 Using VBScript' This code displays the DN of each domain controller's ' nTDSDSA object that is a replica server for the ' specified app partition ' ------ SCRIPT CONFIGURATION ------ ' Fully qualified DNS name of app partition strAppPart = "<AppPartitionFQDN>" ' e.g. apps.rallencorp.com ' ------ END CONFIGURATION --------- set objRootDSE = GetObject("LDAP://RootDSE") strBase = "<LDAP://cn=Partitions," & _ objRootDSE.Get("ConfigurationNamingContext") & ">;" strFilter = "(&(objectcategory=crossRef)(dnsRoot=" & strAppPart & "));" strAttrs = "msDS-NC-Replica-Locations;" strScope = "onelevel" set objConn = CreateObject("ADODB.Connection") objConn.Provider = "ADsDSOObject" objConn.Open "Active Directory Provider" set objRS = objConn.Execute(strBase & strFilter & strAttrs & strScope) if objRS.RecordCount <> 1 then WScript.Echo "Did not find a match for application partition " & _ strAppPart WScript.Quit else objRS.MoveLast if objRS.Fields("msDS-NC-Replica-Locations").Properties.Count > 0 then Wscript.Echo "There are no replica servers for app partition " & _ strAppPart else Wscript.Echo "Replica servers for app partition " & strAppPart & ":" for each strNTDS in objRS.Fields("msDS-NC-Replica-Locations").Value WScript.Echo " " & strNTDS next end if end if 17.4.3 DiscussionThe list of replica servers for an application partition is stored in the multivalued msDS-NC-Replica-Locations attribute on the crossRef object for the application partition. This object is located in the Partitions container in the configuration naming context. 17.4.4 See AlsoRecipe 17.3 for adding and removing replica servers |
[ Team LiB ] |