modifying NT user passwords through ASP

Source: Internet
Author: User
The user login system becomes more and more important in the future web. The simple truth is that since the Web site is now very anxious to be managed and to collect money from members, this is a very normal magazine, and Taiwan's company law makes it clear that "companies aim for profit"

In the security authentication system of IIS 5.0, consolidated Windows Experience (Windows NT Challenge and Response in IIS 4.0) is an easy choice, a simple way to achieve a certain degree of water security, and can integrate Windows 2000 Users, but there is no good, the point is not a good line to change the password system, so today we will introduce how to change the NT user password through ASP



HTML section

When a user is logged into the security area of your site, you can use the Login_user in the ServerVariables collection to learn about the login's account, and of course remember to turn off the anonymous login option, and now let's look at the HTML section

<form action= "changepwd.asp" method= "POST" >
<!--use hidden--> to not allow users to enter their own accounts
<input type= "hidden" name= "UserName"
Value= "<%=request.servervariables (" Login_user ")%>" >
<br> input old password: <input name= "Oldpwd" >
<br> input New password: <input name= "NEWPWD1" >
<br> confirm Xinmi: <input name= "NEWPWD2" >
<input type= "Submit" value= "Change Password" >
</form>

Code

Next is the ASP section to see how to modify the WIndows 2000 user account through ADSI and save the bottom code as a changepwd.asp file name

<%
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 "Please confirm your password again."
End If
%>

Hopefully this article will help you!



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.