Directory Services |
The DsReplicaSyncAll function synchronizes a server with all other servers, using transitive replication, as necessary. By default, DsReplicaSyncAll synchronizes the server with all other servers in its site; however, you can also use it to synchronize across site boundaries.
DWORD DsReplicaSyncAll( HANDLE hDS, LPTSTR pszNameContext, ULONG ulFlags, BOOL (__stdcall * pFnCallBack) (LPVOID, PDS_REPSYNCALL_UPDATEW), LPVOID pCallbackData, PDS_REPSYNCALL_ERRINFO** pErrors );
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_CROSS_SITE_BOUNDARIES | Synchronizes across site boundaries. By default, DsReplicaSyncAll attempts to synchronize only with DCs in the same site as the home system. Set this flag to attempt to synchronize with all DCs in the enterprise forest. However, the DCs can be synchronized only if connected by a synchronous (RPC) transport. |
DS_REPSYNCALL_DO_NOT_SYNC | Disables all synchronization. The topology is still analyzed, and unavailable or unreachable servers are still identified. |
DS_REPSYNCALL_ID_SERVERS_BY_DN | In the event of a non-fatal error, returns server distinguished names (DN) instead of their GUID DNS names. |
DS_REPSYNCALL_NO_OPTIONS | This option has no effect. |
DS_REPSYNCALL_PUSH_CHANGES_OUTWARD | Pushes changes from the home server out to all partners using transitive replication. This reverses the direction of replication, and the order of execution of the replication sets from the usual "pulling" mode of execution. |
DS_REPSYNCALL_SKIP_INITIAL_CHECK | Assumes that all servers are responding. This speeds 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 is performed only with adjacent servers. |
If the function fails, the return value is as follows.
Return Code | Description |
---|---|
ERROR_CANCELLED | The return value from the callback function, pointed to by pFnCallBack, was FALSE, causing replication to be terminated. |
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 bypasses 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 the function pointed to by pFnCallBack. If the return value from the callback function is TRUE, replication continues; otherwise, the DsReplicaSyncAll function terminates replication.
Client: Included in Windows XP and
Windows 2000 Professional.
Server: Included in Windows Server 2003 and
Windows 2000 Server.
Redistributable: Requires Active Directory Client Extension
on Windows NT 4.0 SP6a and Windows 95/98/Me.
Header: Declared in Ntdsapi.h.
Library: Use Ntdsapi.lib.
DsReplicaSync, DS_REPSYNCALL_ERRINFO, DS_REPSYNCALL_UPDATE, SyncUpdateProc, Domain Controller and Replication Management Functions