17.3. Adding or Removing a Replica Server for an Application Partition

Problem

You want to add or remove a replica server for an application partition. After you’ve created an application partition, you should make at least one other server a replica server in case the first server fails.

Solution

Using a command-line interface

Use the following command to add a replica server for an application partition:

> ntdsutil "dom man" conn "co to se <DomainControllerName>" q "add nc replica[RETURN]
<AppPartitionDN> <DomainControllerName>" q q

Use the following command to remove a replica server for an application partition:

> ntdsutil "dom man" conn "co to se <DomainControllerName>" q "remove nc replica[RETURN]
<AppPartitionDN> <DomainControllerName>" q q

Using VBScript

' This code adds or removes a replica server for the
' specified application partition
' ------ SCRIPT CONFIGURATION ------
strAppPart = "<AppPartitionFQDN>" ' DNS name of the application partition

' Hostname of server to add as replica for app partition. 
' This needs to match the common name for the DC's server object.
strServer  = "<DomainControllerName>" ' e.g. dc01 ' Set to True to add server as new replica or False to remove boolAdd = True ' ------ END CONFIGURATION --------- ' Constants taken from ADS_PROPERTY_OPERATION_ENUM const ADS_PROPERTY_APPEND = 3 const ADS_PROPERTY_DELETE = 4 set objRootDSE = GetObject("LDAP://RootDSE") ' ---------------------------------------------------------- ' First find the NTDS Settings object ...

Get Active Directory Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.