Platform SDK: Active Directory, ADSI, and Directory Services

DC and Replication Management Functions

The domain controller (DC) and replication management functions provide tools for finding information about DCs, converting the names of network objects between different formats, manipulating service principal names (SPNs) and directory service agents (DSAs), and managing replication of servers. The following functions allow developers to work with domain controllers, replication, and the directory service.

Function Purpose
DsAddSidHistory The DsAddSidHistory function retrieves the primary account security identifier SID of a security principal from one domain (the source domain) and adds it to the sIDHistory attribute of a security principal in another (destination) domain in a different forest.
DsBind Starts an RPC session with a domain controller using default process credentials.
DsBindWithCred Starts an RPC session with a domain controller.
DsCrackNames Converts object names from one format to another.
DsCrackSpn Parses an SPN into its component pieces.
DsFreeDomainControllerInfo Frees a domain controller information structure created by the DsGetDomainControllerInfo function.
DsFreeNameResult Frees a DS_NAME_RESULT structure created by the DsCrackNames function.
DsFreePasswordCredentials Frees a credential structure created by the DsMakePasswordCredentials function.
DsFreeSchemaGuidMap Frees a DS_SCHEMA_GUID_MAP structure created by the DsMapSchemaGuids function.
DsFreeSpnArray Frees an array created by DsGetSpn.
DsGetDomainControllerInfo Retrieves information about a domain controller.
DsGetSpn Creates an array of one or more SPNs. A service installation program uses this function to construct the SPNs that identify the instances of a service.
DsInheritSecurityIdentity Appends the objectSid and sidHistory of SrcPrincipal to the sidHistory of DstPrincipal and then deletes SrcPrincipal, all in a single transaction.
DsListDomainsInSite Lists all the domains in a site.
DsListInfoForServer Lists miscellaneous information for a server.
DsListRoles Lists the roles that a server knows about.
DsListServersForDomainInSite Lists all the servers in a domain in a site.
DsListServersInSite Lists all the servers in a site.
DsListSites Lists all the sites in the enterprise.
DsMakePasswordCredentials Constructs a credential structure suitable for input to the DsBindWithCred function.
DsMakeSpn Constructs an SPN that a client can use to authenticate a service.
DsMapSchemaGuids Converts object GUIDs into display names.
DsRemoveDsDomain Removes all traces of a domain naming context from the directory service.
DsRemoveDsServer Removes all traces of a DSA from the directory service.
DsReplicaAdd Adds a replication source reference to a destination system.
DsReplicaDel Deletes a replication source reference from a destination system.
DsReplicaModify Modifies a replication source reference on a destination system.
DsReplicaSync Synchronizes a destination naming context with one of its sources.
DsReplicaSyncAll Synchronizes a server with all other servers in its site.
DsReplicaUpdateRefs Updates a replication destination reference on a source system.
DsServerRegisterSpn Creates simple SPNs for a host-based service and either registers or unregisters them on a user or machine account.
DsUnBind Ends an RPC session with a domain controller.
DsWriteAccountSpn Registers or unregisters SPNs on a specified user or machine account object in Active Directory™.
SyncUpdateProc Callback function for use with the DsReplicaSyncAll function.

Most of these functions require a handle bound to the directory service. The DsBind and DsBindWithCred functions start an RPC session with a particular domain controller, then they bind a handle to the directory service and return the handle. When the handle is no longer needed, use the DsUnbind function to end the RPC session and unbind the handle.

Replication occurs between a source server and a destination server. A source server maintains a list of destination servers to which it should replicate, and a destination server maintains a list of source servers from which it receives replication. Use the DsReplicaAdd function to add to the list of source servers on a destination server, and use the DsReplicaDel function to remove references from the source server list on a destination server. The DsReplicaModify function may be used to change an existing source server reference on a destination server. To change the list of destination servers on a source server, use the DsReplicaUpdateRefs function.

Actual replication is performed by the DsReplicaSync and DsReplicaSyncAll functions. The DsReplicaSync function synchronizes a specific destination server with a single source server. Use the DsReplicaSyncAll function to synchronize a destination server with all other servers in the site.

See Also

Active Directory Display Functions, Directory Backup Functions, Directory Service Functions