使用LDAP设置域密码策略并出现“maxPwdAge”错误?

时间:2015-06-16 07:23:52

标签: c# ldap password-policy

var data = new DirectoryEntry("LDAP://xxx.xxx", LdapAdUserName, LdapAdPassword);
data.data.Properties["LockoutThreshold"].Value = 10;`
data.data.Properties["maxPwdAge"].Value = 90;
data.CommitChanges();

我尝试更改AD上的域密码策略。 首先,我尝试更新“LockoutThreshold”=>好 其次,我尝试更新“maxPwdAge”=>提交时的异常

例外:

An exception of type 'System.DirectoryServices.DirectoryServicesCOMException' occurred in System.DirectoryServices.dll but was not handled in user code

为什么不能设置“maxPwdAge”??

1 个答案:

答案 0 :(得分:0)

据我所知,你需要成为域管理员,也许这会对How to get maxpwdAge attribute value in ActiveDirectory using C++?有帮助,这是在C ++上,但原则是一样的。

相关问题