惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
P
Privacy International News Feed
T
Tenable Blog
L
Lohrmann on Cybersecurity
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Threat Research - Cisco Blogs
S
Securelist
C
CXSECURITY Database RSS Feed - CXSecurity.com
Cisco Talos Blog
Cisco Talos Blog
T
The Exploit Database - CXSecurity.com
S
Schneier on Security
P
Privacy & Cybersecurity Law Blog
Vercel News
Vercel News
Cyberwarzone
Cyberwarzone
月光博客
月光博客
T
The Blog of Author Tim Ferriss
Scott Helme
Scott Helme
爱范儿
爱范儿
Stack Overflow Blog
Stack Overflow Blog
C
Cisco Blogs
aimingoo的专栏
aimingoo的专栏
博客园 - 司徒正美
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
P
Proofpoint News Feed
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
L
LangChain Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
阮一峰的网络日志
阮一峰的网络日志
Simon Willison's Weblog
Simon Willison's Weblog
T
Tor Project blog
Security Latest
Security Latest
Blog — PlanetScale
Blog — PlanetScale
G
GRAHAM CLULEY
V
Vulnerabilities – Threatpost
博客园 - 三生石上(FineUI控件)
I
InfoQ
Spread Privacy
Spread Privacy
B
Blog RSS Feed
Microsoft Azure Blog
Microsoft Azure Blog
S
SegmentFault 最新的问题
云风的 BLOG
云风的 BLOG
Last Week in AI
Last Week in AI
MongoDB | Blog
MongoDB | Blog
C
CERT Recently Published Vulnerability Notes
A
About on SuperTechFans
博客园_首页
Engineering at Meta
Engineering at Meta
Project Zero
Project Zero
Latest news
Latest news

博客园 - 洪虎

Windows环境下安装Python 建立批命令快速修改本机IP地址 网络经典命令 - 洪虎 - 博客园 “指定域的名称或安全标识SID与该域的信任信息不一致”的解决方法 建立主DNS区域和辅助DNS区域的最佳实践 无人职守安装 XP 电脑黑客基本技术和入侵的关键字以及电脑攻防应用 修复SQL2000中损坏的表 将Excel转换为CSV的VBA代码 - 洪虎 - 博客园 用命令检查电脑是否被安装木马 DateTime.ToString 方法 - 洪虎 - 博客园 在C#中自定义异常 - 洪虎 - 博客园 使用DataDynamics.ActiveReports 创建子报表 错误的SQL脚本,错误消息 4104 - 洪虎 - 博客园 适配器模式 如何在 Reporting Services 开发基于用户权限的报表呢? 委托模式 接口模型 使用反射检查程序集,实现自动更新
建立一个可修改Windows域用户密码的web页面
洪虎 · 2006-12-22 · via 博客园 - 洪虎

摘自IT Pro 2004-8-25 14:54:26 winmag 作者:winmag

怎样建立一个可以供用户修改密码的web页面?

你可以使用动态服务器主页(AS))脚本建立一个密码修改页面。ASP能够完全访问微软活动目录服务界面(ADSI),以让你可以使用不同的功能。比如修改密码或者建立帐号。当你编写这样脚本的时候,你必须考虑诸如脚本在哪个帐号下运行或者你希望运行此脚本的权限等因素。最基本的修改用户密码的ADSI命令是:

set usr = GetObject("LDAP://CN=John

Savill,CN=Users,DC=savilltech,DC=com")

usr.put "userPassword", NewPassword

第一行(因为空格的缘故显示为两行)为域savilltech.com中用户john savil赋一个句柄。下一行将文本newpassword放到userpassword属性中

我编写了一个简短名为changpass.asp的脚本以提示用户输入用户名和密码(注意将savilltech.com替换为你当前的域名).changepass.asp代码可以在此处下载。如下面所示:

<%

strUserCN = request.form("cn")

strNewPassword = request.form("newpass")

strPassVerify = request.form("passverify")

if strUserCN="" then

    response.write "<html><head><title>Change Password</title></head><body>"

    response.write "<center><h1>Web Password Reset</h1></center>"

    response.write "<hr><br><br><form method=post action=changepass.asp><table>"

    response.write "<tr><td>CN: </td><td><input type=text name=cn></td><tr>"

    response.write "<tr><td>New Password: </td><td><input type=password name=newpass></td></tr>"

    response.write "<tr><td>Verify Password: </td><td><input type=password name=passverify></td></tr>"

    response.write "<tr><td colspan=2 align=center><input type=submit value='Reset Password'></td></tr>"

    response.write "</table></body></html>"

    response.end

else

if strNewPassword = strPassVerify then

set usr = GetObject("LDAP://CN=" & strUserCN & ",CN=Users,DC=savilltech,DC=com")

usr.put "userPassword", strNewPassword

response.write "<html><head><title>Results</title></head><center><h1>Update Results</h1></center><hr><br><br>"

response.write strUserCN & ": password was successfully updated"

response.end

else

    response.write "<html><head><title>Error!</title></head><body>"

    response.write "<center><h1>An Error Has Occurred!</h1></center>"

    response.write "<hr><br><br>"

    response.write "The password and confirmation do not match. Please go back and try again."

    response.end

end if

end if

在之前我们讨论的一个关于“是否windows2003提供了一个让用户远程通过web修改密码的方法的问题,windows server 2003 自己提供了一个网页来修改密码。然而,你会发现在自己的web页面或者站点利用实例ASP脚本建立一个密码修改界面是非常有用的。