<HTML>
<Title>
Change NT user password
</Title>
<Body>
<%
Sub
Changeuserpassword (computer, username, oldpassword, newpassword)
Dim adsuser, founderr, errmsg
On Error resume next
Founderr = false
Errmsg = ""
Set
Adsuser = GetObject ("winnt: //" + computer + "/" + username + ", user ")
If err. Number <> 0 then
Founderr = true
Errmsg = "user not found! "
Err. Clear
Else
Adsuser. changepassword oldpassword, newpassword
Adsuser. setinfo
If err. Number <> 0 then
Founderr = true
Errmsg = now & ". Error Code:" & hex (ERR )&"-"&
Err. Description & "<br>"
Err. Clear
End if
End if
If not founderr then
Objcontext. setcomplete
Response. Write "<font color = Red> <B> the password has been modified!
</B> <br>"
Response. Write "</font>"
Else
Objcontext. setabort
Response. Write "<font
Color = Red> <B> incorrect old password. Please enter the correct old password again! </B> <br> "& errmsg
Response. Write "</font>"
End if
Set adsuser = nothing
End sub
Response. Write "<center> <H2> change NT user password </H2> </center>"
Computer = "penguinliang"
Username = "Administrator"
Oldpassword = "loving"
Newpassword = "loved"
Changeuserpassword
Computer, username, oldpassword, newpassword
%>
</Body>
</Html>
The name and password of the computer are in the subsequent code.