这个也许是你所要的,试试看。Private Declare Function NetUserChangePassword Lib "Netapi32.dll" (Domain As Any, User As Any, oldPass As Byte, NewPass As Byte) As Long
NetUserChangePassword
==========================================
The NetUserChangePassword function changes a user's password for a specified network server or domain.Security Requirements
A server or domain can be configured to require a user to log on before changing the password on a user account. In that case, only members of the Administrators or Account Operators local group or the user himself can change the password for a user account. If logging on is not required, the user can change the password for any user account, as long as the user knows the current password.
NetUserChangePassword
==========================================
The NetUserChangePassword function changes a user's password for a specified network server or domain.Security Requirements
A server or domain can be configured to require a user to log on before changing the password on a user account. In that case, only members of the Administrators or Account Operators local group or the user himself can change the password for a user account. If logging on is not required, the user can change the password for any user account, as long as the user knows the current password.
Dim szOldPass As String
Dim szNewPass As StringOn Error GoTo Cleanup
Set usr = GetObject("WinNT://Fabrikam/JeffSmith,user")
' Add code to securely retrieve the old and new password.usr.ChangePassword szOldPass, szNewPass
Cleanup:
If (Err.Number<>0) Then
MsgBox("An error has occurred. " & Err.Number)
End If
Set usr = Nothing详细信息请参考:IADsUser::ChangePassword
http://msdn.microsoft.com/library/en-us/netdir/adsi/iadsuser_changepassword.asp
- 微软全球技术中心 VB技术支持本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利。具体事项可参见使用条款
(http://support.microsoft.com/directory/worldwide/zh-cn/community/terms_chs.asp)。为了为您创建更好的讨论环境,请参加我们的用户满意度调查
(http://support.microsoft.com/directory/worldwide/zh-cn/community/survey.asp?key=(S,49854782))。