每当我试图将UserPrincipal保存到Active并且UserPrincipalName或EmailAddress长度超过20个字符时,UserPrincipal.Save方法将引发以下错误:
'System.DirectoryServices.AccountManagement.PrincipalOperationException‘连接到系统上的设备不能正常工作
如何保存长度超过20个字符的电子邮件地址?
发布于 2014-12-22 09:55:14
只要没有指定UserPrincipal.Name,UserPrincipal.SamAccountName就会被复制到SamAccountName中。
当UserPrincipal.Name超过20个字符时,这当然会引发异常。在这种情况下是个怪人。为了解决这个问题,我必须在保存到少于20个字符之前手动设置SamAccountName。
https://stackoverflow.com/questions/27593220
复制相似问题