Platform SDK: Active Directory, ADSI, and Directory Services

DsSetAuthIdentity

The DsSetAuthIdentity function sets the security context under which the directory backup APIs are called.

HRESULT DsSetAuthIdentity(
  LPCWSTR szUserName,
  LPCWSTR szDomainName,
  LPCWSTR szPassword
);

Parameters

szUserName
[in] Name of the user.
szDomainName
[in] Name of the domain the user belongs to.
szPassword
[in] Password of the user in the specified domain.

Return Values

One of the standard HRESULT success codes; otherwise, a failure code.

Remarks

If DsSetAuthIdentity is not called, security context of the current process is assumed.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Ntdsbcli.h.
  Library: Included as a resource in Ntdsbcli.dll.
  Unicode: Implemented as Unicode and ANSI versions on Windows 2000.

See Also

Backing Up and Restoring Active Directory, Directory Backup Functions