如何使用 System.DirectoryServices.Protocols 更改密码
我们的用户存储是一个名为 eDirectory 的 LDAP 服务器。如何使用 System.DirectoryServices.Protocols 更改用户密码?
Our user store is an LDAP server called eDirectory. How do you change user passwords using System.DirectoryServices.Protocols?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我使用与此类似的代码连接到基于 Sun One 的 LDAP 来更改用户的密码。 (与 Novell eDirectory 应该没有什么不同...)
I've used code similar to this to connect to a Sun One-based LDAP to change a user's password. (Shouldn't be that different from Novell eDirectory...)
您需要删除密码,然后重新添加。当我这样做时,我使用了 Novell 的 LDAP 库。您可能需要尝试使用 DirectoryEntry 才能使其正常工作。
删除eDirectory - LDAP 通过 ADSI/System.DirectoryServices 中的不可读属性
根据您在 eDirectory 中使用的密码类型,您可能会遇到问题
eDirectory 8.8 的 LDAP/通用密码
如何通过 LDAP 更改 eDirectory 或通用密码
这是 ldif 示例
You need to remove the password and then re-add it. When I did this I used the LDAP library from Novell. You may have to play around with DirectoryEntry to get it to work.
Deleting non readable attribute from eDirectory - LDAP through ADSI/System.DirectoryServices
you might run into issues depending on the type of password you are using in eDirectory
LDAP / Universal Password with eDirectory 8.8
How to change eDirectory or Universal Password through LDAP
here is an ldif sample
我同意 Per Noalt 和 Matthew Whited 两人的方法。但其中有一个微妙之处。
用户密码更改和管理密码更改之间存在差异。
如果您替换 userPassword,即为管理员密码更改,并且根据密码策略,密码可能会立即过期。 (eDir 使用密码过期,然后计算宽限登录次数)。
如果您提供旧密码和新密码,则您正在进行用户启动的密码重置。
I agree with the approaches of two of Per Noalt and Matthew Whited. But there is one subtlty of import.
There is a difference between a user password change and an administrative password change.
If you replace the userPassword, that is an Admin password change, and depending on password policies, might expire the password right away. (eDir uses password expiry, and then a count of grace logins).
If you provide the old and new password, then you are doing a user initiated password reset.
书中有一个使用 System.DirectoryServices.Protocols 更改用户密码和管理密码的代码示例 目录服务编程的 .net 开发人员指南。我认为出于版权原因我无法在此处粘贴代码示例,但如果您有兴趣使用 System.DirectoryServices.Protocols 和 System.DirectoryServices,我建议您购买这本书。
There is a code example for both user changing password and administrative password change using System.DirectoryServices.Protocols in the book the .net developer's guide to directory services programming. I assume that I can't paste the code example here for copyright reasons but I can recommend buying the book if you are interested working with System.DirectoryServices.Protocols and System.DirectoryServices.