修改AD密码的方法

本文介绍了一种在Windows 2003系统中通过IIS进行密码修改的方法,包括复制和共享特定目录、配置ASP支持、重命名文件及访问特定URL完成密码修改的过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在win2003中已经具备这个功能,为何不用
1、将C:\WINDOWS\system32\inetsrv下面的整个iisadmpwd目录复制到C:\Inetpub\wwwroot下(仅为了不破坏原始文件)
2、WEB共享iisadmpwd目录到80网站上,默认读取和脚本权限即可
3、检查IIS服务的ASP支持是否安装
4、将aexp2.asp更名为default.asp,并根据自己需要修改这个文件,例如没启用证书则将https改为http
5、访问http://moss/iisadmpwd即可修改密码了

这个方法修改密码比写个webpart更安全更标准(因为这个是官方解决方案,哈哈)。

 

try
{
DirectoryEntry entry1 = new DirectoryEntry("LDAP://" + domain, this._username, this._oldPassword);
DirectorySearcher searcher1 = new DirectorySearcher(entry1);
searcher1.Filter = "(samAccountName=" + this._username + ")";
result1 = searcher1.FindOne();
DirectoryEntry entry2 = result1.GetDirectoryEntry();
entry2.Invoke("ChangePassword", new object[] { this.tbOldPassword.Text, this.tbNewPassword.Text });
entry2.CommitChanges();
entry2.Close();
entry1.Close();

}
catch
{

}

转载于:https://www.cnblogs.com/chenfulai/archive/2009/03/10/1407870.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值