ChangeAccountPassword function

The ChangeAccountPassword function changes the password for a Windows domain account by using the specified Security Support Provider.

This function is supported only by the Microsoft Kerberos, Microsoft Negotiate, and Microsoft NTLM providers.

Syntax


SECURITY_STATUS ChangeAccountPassword(
  _In_    SEC_WCHAR      *pszPackageName,
  _In_    SEC_WCHAR      *pszDomainName,
  _In_    SEC_WCHAR      *pszAccountName,
  _In_    SEC_WCHAR      *pszOldPassword,
  _In_    SEC_WCHAR      *pszNewPassword,
  _In_    BOOLEAN        bImpersonating,
  _In_    unsigned long  dwReserved,
  _Inout_ PSecBufferDesc pOutput
);

Parameters

pszPackageName [in]

The name of the provider to use. The value of this parameter must be either "Kerberos", "Negotiate", or "NTLM".

pszDomainName [in]

The domain of the account for which to change the password.

pszAccountName [in]

The user name of the account for which to change the password.

pszOldPassword [in]

The old password to be changed.

pszNewPassword [in]

The new password for the specified account.

bImpersonating [in]

TRUE if the calling process is running as the client; otherwise, FALSE.

dwReserved [in]

Reserved. Must be set to zero.

pOutput [in, out]

On input, a pointer to a SecBufferDesc structure. The SecBufferDesc structure must contain a single buffer of type SECBUFFER_CHANGE_PASS_RESPONSE. On output, the pvBuffer member of that structure points to a DOMAIN_PASSWORD_INFORMATION structure.

Return value

If the function succeeds, the function returns SEC_E_OK.

If the function fails, it returns an error code.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Sspi.h

Library

Secur32.lib

DLL

Secur32.dll

Unicode and ANSI names

ChangeAccountPasswordW (Unicode) and ChangeAccountPasswordA (ANSI)

 

 

Show: