[英]How do I set a users UserPrincipleName in LDAP through ASP.NET MVC?
這是我嘗試過的:
PrincipalContext context = new PrincipalContext(ContextType.ApplicationDirectory, "dev", "cn=" + SupplierName + ",cn=suppliers,o=dd");
UserPrincipal user = UserPrincipal.FindByIdentity(context, Username);
user.UserPrincipalName = Username;
不會發生任何錯誤,但不會在LDAP中進行更改。
使用Save()
方法。
User.Save()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.