asp更改Windows2000管理者密码?
时间:2010-06-26 11:03:00
如何在线更改Windows2000管理者密码?
changepwd.htm
<html>
<head>
<title>精彩春风之在线修改Windows2000密码</title>
</head>
<body>
<form action="changepwd.asp" method="post">
<!--使用隐藏-->
<input type="hidden" name="UserName"
value="<%=Request.ServerVariables("LOGIN_USER")%>">
<br>输入旧密码: <input name="OldPwd">
<br>输入新密码: <input name="NewPwd1">
<br>确认新密码: <input name="NewPwd2">
<input type="submit" value="更改">
</form>
</body>
</html>
changepwd.asp
<%
OldPwd = Request.Form("OldPwd")
NewPwd1 = Request.Form("NewPwd1")
NewPwd2 = Request.Form("NewPwd2")
UserName = Request.Form("UserName")
If NewPwd1 = NewPwd2 Then
Set oUser = GetObject("WinNT://ComputerName/" & UserName)
oUser.ChangePassword OldPwd, NewPwd1
oUser.SetInfo
Set oUser = Nothing
Else
Response.Write "请再次确认密码!"
End If
%>