DsRemoveDsServerW function (ntdsapi.h)
The DsRemoveDsServer function removes all traces of a directory service agent (DSA) from the global area of the directory service.
NTDSAPI DWORD DsRemoveDsServerW( [in] HANDLE hDs, [in] LPWSTR ServerDN, [in, optional] LPWSTR DomainDN, [out, optional] BOOL *fLastDcInDomain, [in] BOOL fCommit );
Pointer to a null-terminated string that specifies the fully qualified distinguished name of the domain controller to remove.
[in, optional] DomainDN
Pointer to a null-terminated string that specifies a domain hosted by ServerDN. If this parameter is NULL, no verification is performed to ensure that ServerDN is the last domain controller in DomainDN.
[out, optional] fLastDcInDomain
Pointer to a Boolean value that receives TRUE if ServerDN is the last DC in DomainDN or FALSE otherwise. This parameter receives FALSE if DomainDN is NULL.
Contains a Boolean value that specifies if the domain controller should actually be removed. If this parameter is nonzero, ServerDN is removed. If this parameter is zero, the existence of ServerDN is checked and fLastDcInDomain is written, but the domain controller is not removed.
Returns ERROR_SUCCESS if successful or a Win32 or RPC error code if unsuccessful. Possible error codes include the following.
The ntdsapi.h header defines DsRemoveDsServer as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
|Minimum supported client||Windows Vista|
|Minimum supported server||Windows Server 2008|