DsRemoveDsDomainA function (ntdsapi.h)

The DsRemoveDsDomain function removes all traces of a domain naming context from the global area of the directory service.

Syntax

NTDSAPI DWORD DsRemoveDsDomainA(
  [in] HANDLE hDs,
  [in] LPSTR  DomainDN
);

Parameters

[in] hDs

Contains a directory service handle obtained from either the DSBind or DSBindWithCred function.

[in] DomainDN

Pointer to a null-terminated string that specifies the distinguished name of the naming context to remove from the directory service.

Return value

Returns ERROR_SUCCESS if successful or a Win32 or RPC error code if unsuccessful. Possible error codes include the following.

Remarks

Note

The ntdsapi.h header defines DsRemoveDsDomain 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.

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header ntdsapi.h
Library Ntdsapi.lib
DLL Ntdsapi.dll

See also

Domain Controller and Replication Management Functions

DsBind

DsBindWithCred

DsRemoveDsServer