(0) exportieren Drucken
Alle erweitern
EN
Dieser Inhalt ist in Ihrer Sprache leider nicht verfügbar. Im Folgenden finden Sie die englische Version.
Dieser Artikel wurde noch nicht bewertet - Dieses Thema bewerten.

DsBindWithCred function

The DsBindWithCred function binds to a domain controller using the specified credentials.

Syntax


DWORD DsBindWithCred(
  _In_opt_  LPCTSTR DomainControllerName,
  _In_opt_  LPCTSTR DnsDomainName,
  _In_opt_  RPC_AUTH_IDENTITY_HANDLE AuthIdentity,
  _Out_     HANDLE *phDS
);

Parameters

DomainControllerName [in, optional]

Pointer to a null-terminated string that contains the fully qualified DNS name of the domain to bind. For more information about this parameter, see the DomainControllerName description in the DsBind topic.

DnsDomainName [in, optional]

Pointer to a null-terminated string that contains the fully qualified DNS name of the domain to bind to. For more information about this parameter, see the DnsDomainName description in the DsBind topic.

This parameter is required to secure a Kerberos authentication.

AuthIdentity [in, optional]

Contains an RPC_AUTH_IDENTITY_HANDLE value that represents the credentials to be used for the bind. The DsMakePasswordCredentials function is used to obtain this value. If this parameter is NULL, the credentials of the calling thread are used.

DsUnBind must be called before freeing this handle with the DsFreePasswordCredentials function.

phDS [out]

Address of a HANDLE value that receives the binding handle. To close this handle, pass it to the DsUnBind function.

Return value

Returns ERROR_SUCCESS if successful or a Windows or RPC error code otherwise. The following are the most common error codes.

Return codeDescription
ERROR_INVALID_PARAMETER

phDS is invalid.

ERROR_NO_SUCH_DOMAIN

No domain controller is available for the specified domain or the domain does not exist.

ERROR_INVALID_DOMAINNAME

The format of the specified DnsDomainName is invalid.

ERROR_NOT_ENOUGH_MEMORY

There is insufficient memory available.

 

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Redistributable

Active Directory Client Extension on Windows NT 4.0 and Windows Me/98/95

Header

Ntdsapi.h

Library

Ntdsapi.lib

DLL

Ntdsapi.dll

Unicode and ANSI names

DsBindWithCredW (Unicode) and DsBindWithCredA (ANSI)

See also

DOMAIN_CONTROLLER_INFO
DsBind
DsGetDcName
DsMakePasswordCredentials
DsUnBind
DsFreePasswordCredentials
Mutual Authentication Using Kerberos
Domain Controller and Replication Management Functions

 

 

Fanden Sie dies hilfreich?
(1500 verbleibende Zeichen)
Vielen Dank für Ihr Feedback.
Anzeigen:
© 2014 Microsoft. Alle Rechte vorbehalten.