0 out of 2 rated this helpful - Rate this topic

ChangeAccountPassword function

Applies to: desktop apps only

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

Minimum supported server

Windows Server 2008

Header

Sspi.h

Library

Secur32.lib

DLL

Secur32.dll

Unicode and ANSI names

ChangeAccountPasswordW (Unicode) and ChangeAccountPasswordA (ANSI)

 

 

Send comments about this topic to Microsoft

Build date: 3/13/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ