Platform SDK: Active Directory, ADSI, and Directory Services

DsReplicaSyncAll

The DsReplicaSyncAll function synchronizes a server with all other servers in its site, using transitive replication as necessary.

DWORD DsReplicaSyncAll(
  HANDLE hDS,
  LPTSTR pszNameContext,
  ULONG ulFlags,
  BOOL (__stdcall *pFnCallBack) (LPVOID, PDS_REPSYNCALL_UPDATE),
  LPVOID pCallbackData,
  PDS_REPSYNCALL_ERRINFO **pErrors
);

Parameters

hDS
[in] Bind handle to the directory service.
pszNameContext
[in] Pointer to a null-terminated Unicode string specifying the distinguished name (DN) of the naming context to synchronize. The pszNameContext parameter is optional; if its value is NULL, the configuration naming context will be replicated.
ulFlags
[in] Passes additional information to be used to process the request. This parameter can be a combination of the following values.
Value Meaning
DS_REPSYNCALL_ABORT_IF_SERVER_UNAVAILABLE Generates a fatal error if any server cannot be contacted or if any server is unreachable due to a disconnected or broken topology.
DS_REPSYNCALL_DO_NOT_SYNC Disables all synchronization. The topology will still be analyzed, and unavailable or unreachable servers will still be identified.
DS_REPSYNCALL_ID_SERVERS_BY_DN In the event of a non-fatal error, returns server distinguished names (DN) instead of their GUID domain name service (DNS) names.
DS_REPSYNCALL_NO_OPTIONS This option has no effect.
DS_REPSYNCALL_SKIP_INITIAL_CHECK Assumes all servers are responding. This will speed operation of the DsReplicaSyncAll function, but if some servers are not responding, some transitive replications may be blocked.
DS_REPSYNCALL_SYNC_ADJACENT_SERVERS_ONLY Disables transitive replication. Synchronization will only be performed with adjacent servers.

pFnCallBack
[in, optional] Pointer to an application-defined function to be executed by the DsReplicaSyncAll function when it encounters an error, initiates synchronization of two servers, finishes synchronization of two servers, or finishes sychronization of all the servers in the site. For more information on the callback function, see SyncUpdateProc.
pCallbackData
[in, optional] Pointer to data that will be passed to the first argument of the callback function pointed to by pFnCallBack.
pErrors
[out, optional] Pointer to a variable that receives a pointer to an array of DS_REPSYNCALL_ERRINFO structures containing errors which occurred during synchronization.

Return Values

If the function performs its operation successfully, the return value is ERROR_SUCCESS.

If the function fails, the return value can be one of the following.

ERROR_CANCELLED
The return value from the callback function pointed to by pFnCallBack was FALSE, causing replication to be terminated.

Remarks

The DsReplicaSyncAll function attempts to bind to all servers before generating a topology to synchronize from. If a server cannot be contacted, the function excludes that server from the topology and attempts to route around it. Setting the DS_REPSYNCALL_SKIP_INITIAL_CHECK flag in ulFlags will bypass the initial binding.

If a server cannot be contacted, the DsReplicaSyncAll function attempts to route around it and replicate from as many servers as possible, unless DS_REPSYNCALL_ABORT_IF_SERVER_UNAVAILABLE is set in ulFlags.

The DsReplicaSyncAll function can use the callback function pointed to by pFnCallBack to keep an end user informed about the current status of the replication. Execution of the DsReplicaSyncAll function pauses when it calls pFnCallBack. If the return value from the callback function is TRUE, replication will continue; otherwise, the DsReplicaSyncAll function will terminate replication.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Ntdsapi.h.
  Library: Included as a resource in Ntdsapi.dll.

See Also

DC and Replication Management Functions, DsReplicaSync, DS_REPSYNCALL_ERRINFO, DS_REPSYNCALL_UPDATE, SyncUpdateProc