Thanks
Jerry
And, unless I'm missing something, "SERVER" is the local domain.
--
. . . . . . . . . . . . . . . . . . . . . .
Klaus H. Probst, MVP
http://www.vbbox.com/
Please post/reply to the newsgroup(s)
"xiaohang zhu" <zhuxi...@hotmail.com> wrote in message
news:5e7343af.02091...@posting.google.com...
Just pass NULL to the domainname parameter:
NET_API_STATUS NetUserChangePassword(
LPCWSTR domainname,
LPCWSTR username,
LPCWSTR oldpassword,
LPCWSTR newpassword
);
Parameters
domainname
[in] Pointer to a constant string that specifies the DNS or NetBIOS name
of a remote server or domain on which the function is to execute. If this
parameter is NULL, the logon domain of the caller is used.
Windows NT 4.0 and earlier: This string must begin with \\.
username
[in] Pointer to a constant string that specifies a user name. The
NetUserChangePassword function changes the password for the specified
user.
If this parameter is NULL, the logon name of the caller is used. For more
information, see the following Remarks section.
oldpassword
[in] Pointer to a constant string that specifies the user's old password.
newpassword
[in] Pointer to a constant string that specifies the user's new password.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Unsupported.
Header: Declared in Lmaccess.h; include Lm.h.
Library: Use Netapi32.lib.
For Win 95/98/ME you have to use PwdChangePassword
--
~Rob (Gunner)
IE Zone Editor
Gunner's RiFLE
http://www.gunner-inc.com
You can check the following article for more information about changing
password:
HOWTO: Change Passwords Programmatically in Windows NT/2000/XP
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q151546
Regards,
Elan Zhou
This posting is provided "AS IS" with no warranties, and confers no rights.
Got .Net? http://www.gotdotnet.com