UID | title | description | helpviewer_keywords | old-location | tech.root | ms.assetid | ms.date | ms.keywords | req.header | req.include-header | req.target-type | req.target-min-winverclnt | req.target-min-winversvr | req.kmdf-ver | req.umdf-ver | req.ddi-compliance | req.unicode-ansi | req.idl | req.max-support | req.namespace | req.assembly | req.type-library | req.lib | req.dll | req.irql | targetos | req.typenames | req.redist | ms.custom | f1_keywords | dev_langs | topic_type | api_type | api_location | api_name | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NF:dsgetdc.DsGetDcOpenA |
DsGetDcOpenA function (dsgetdc.h) |
Opens a new domain controller enumeration operation. (ANSI) |
|
ad\dsgetdcopen.htm |
ad |
2811cc30-f367-4f1a-8f0c-ed0a77dad24c |
12/05/2018 |
DS_FORCE_REDISCOVERY, DS_GC_SERVER_REQUIRED, DS_KDC_REQUIRED, DS_NOTIFY_AFTER_SITE_RECORDS, DS_ONLY_DO_SITE_NAME, DS_ONLY_LDAP_NEEDED, DS_PDC_REQUIRED, DsGetDcOpen, DsGetDcOpen function [Active Directory], DsGetDcOpenA, DsGetDcOpenW, ad.dsgetdcopen, dsgetdc/DsGetDcOpen, dsgetdc/DsGetDcOpenA, dsgetdc/DsGetDcOpenW |
dsgetdc.h |
Windows |
Windows Vista |
Windows Server 2008 |
DsGetDcOpenW (Unicode) and DsGetDcOpenA (ANSI) |
Netapi32.lib |
Netapi32.dll |
Windows |
19H1 |
|
|
|
|
|
|
The DsGetDcOpen function opens a new domain controller enumeration operation.
Pointer to a null-terminated string that contains the domain naming system (DNS) name of the domain to enumerate the domain controllers for. This parameter cannot be NULL.
Contains a set of flags that modify the behavior of the function. This can be zero or a combination of one or more of the following values.
Only site-specific domain controllers are enumerated.
The DsGetDcNext function will return the ERROR_FILEMARK_DETECTED value after all of the site-specific domain controllers are retrieved. DsGetDcNext will then enumerate the second group, which contains all domain controllers in the domain, including the site-specific domain controllers contained in the first group.
Pointer to a null-terminated string that contains the name of site the client is in. This parameter is optional and may be NULL.
Pointer to a GUID value that contains the identifier of the domain specified by DnsName. This identifier is used to handle the case of a renamed domain. If this value is specified and the domain specified in DnsName is renamed, this function attempts to enumerate domain controllers in the domain that contains the specified identifier. This parameter is optional and may be NULL.
Pointer to a null-terminated string that contains the name of the forest that contains the DnsName domain. This value is used in conjunction with DomainGuid to enumerate the domain controllers if the domain has been renamed. This parameter is optional and may be NULL.
Contains a set of flags that identify the type of domain controllers to enumerate. This can be zero or a combination of one or more of the following values.
Forces cached domain controller data to be ignored. When this flag is not specified, DsGetDcOpen obtains the domain controller enumeration from cached domain controller data.
Requires that the enumerated domain controllers be global catalog servers for the forest of domains with this domain as the root. This flag cannot be combined with the DS_PDC_REQUIRED flag.
Requires that the enumerated domain controllers currently be running the Kerberos Key Distribution Center service. This flag cannot be combined with the DS_PDC_REQUIRED or DS_GC_SERVER_REQUIRED flags.
Specifies that the enumerated servers are LDAP servers. The servers are not necessarily domain controllers. No other services are implied to be present at each enumerated server. The servers do not necessarily have a writable config container nor a writable schema container. The servers may not necessarily be used to create or modify security principles. This flag may be used with the DS_GC_SERVER_REQUIRED flag to enumerate LDAP servers that also host a global catalog server. In that case, the enumerated global catalog servers are not necessarily domain controllers and other services are implied to be present at each server. If this flag is specified, the DS_PDC_REQUIRED, DS_TIMESERV_REQUIRED, DS_GOOD_TIMESERV_PREFERRED, DS_DIRECTORY_SERVICES_PREFERED, DS_DIRECTORY_SERVICES_REQUIRED, and DS_KDC_REQUIRED flags are ignored.
Requires that the enumerated domain controllers be the primary domain controllers for the domain. This flag cannot be combined with the DS_GC_SERVER_REQUIRED flag.
Pointer to a HANDLE value that receives the domain controller enumeration context handle. This handle is used with the DsGetDcNext function to identify the domain controller enumeration operation. This handle is passed to DsGetDcClose to close the domain controller enumeration operation.
Returns ERROR_SUCCESS if successful or a Win32 or RPC error otherwise. Possible error values include the following.
Enumerating Domain Controllers
Note
The dsgetdc.h header defines DsGetDcOpen 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.