我正在访问Active Directory,以便使用以下代码从我的ASP.Net MVC帐户的Directory Server中获取员工Id。
我可以得到给定的姓名、SurName和语音电话号码,但不能得到员工的ID.But,我确信它就在那里。
我在一台机器上开发,在另一台机器上部署,所以我是否可以通过某种方式从代码中验证到active directory,并获得员工的Id.what?感谢您的帮助。
PrincipalContext context = new PrincipalContext(ContextType.Domain);
UserPrincipal foundUser = UserPrincipal.FindByIdentity(context, "username");
string employeeId = foundUser.EmployeeId;发布于 2010-08-14 04:36:53
原因是active directory将"employeeId“作为属性属性。
https://stackoverflow.com/questions/3472200
复制相似问题