win32net.NetUserChangePassword

NetUserChangePassword(server, username, oldPassword, newPassword)

Changes the password for a user.

Parameters

server : string/PyUnicode

The name of the server, or None.

username : string/PyUnicode

The user name, or None for the current username.

oldPassword : string/PyUnicode

The old password

newPassword : string/PyUnicode

The new password

Comments

A server or domain can be configured to require that a user log on to change the password on a user account. If that is the case, you need administrator or account operator access to change the password for another user acount. If logging on is not required, you can change the password for any user account, so long as you know the current password.

Win32 API References

Search for NetUserChangePassword at msdn, google or google groups.