NetUserChangePassword (netapi32)
Last changed: chris harnetty-199.67.203.138

.
Summary
Provide a user account and its existing password, and this API allows you to choose a new password for the account.

C# Signature:

[DllImport("netapi32.dll", CharSet=CharSet.Unicode)]
static extern int NetUserChangePassword(string domain, string user, string oldPassword, string newPassword);

VB Signature:

Declare Function NetUserChangePassword Lib "netapi32.dll" (ByVal domain as String, ByVal user as String, ByVal oldPassword as String, ByVal newPassword as String) As Integer

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

None.

Tips & Tricks:

To change the password of the current user (or currently impersonated user), pass null for the first two args.

Sample Code:

Please add some!

Documentation