rectory属性不能再由UserPrincipal类psent

rectory属性不能再由UserPrincipal类psent

本文介绍了如何获得Active Directory属性不能再由UserPrincipal类psented $ P $的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的意思是,现在我使用System.DirectoryServices.AccountManagement,如果我使用UserPrincipal类我只看到名字,中间名等

What I mean is that right now I am using System.DirectoryServices.AccountManagement and if I use UserPrincipal class I only see the Name, Middle Name, etc

所以在我的codeS像

so in my codes it like

UserPrincipal myUser = new UserPrincipal(pc);
myUser.Name = "aaaaaa";
myUser.SamAccountName = "aaaaaaa";
.
.
.
.
myUser.Save();

我怎么会看到属性,如移动或信息?

How would I see the attribute like mobile or info?

推荐答案

做的正确的方法是使用,你扩展你所追求的校长和使用方法ExtensionSet和ExtensionGet如下解释PrincipalExtensions<一href="http://anyrest.word$p$pss.com/2010/10/14/how-to-use-ad-attributes-not-re$p$psented-in-userprincipal-groupprincipal-and-computerprincipal/">http://anyrest.word$p$pss.com/2010/10/14/how-to-use-ad-attributes-not-re$p$psented-in-userprincipal-groupprincipal-and-computerprincipal/

The proper way of doing it is by using PrincipalExtensions where you Extend the Principal you are after and use the methods ExtensionSet and ExtensionGet as explained herehttp://anyrest.wordpress.com/2010/10/14/how-to-use-ad-attributes-not-represented-in-userprincipal-groupprincipal-and-computerprincipal/

这篇关于如何获得Active Directory属性不能再由UserPrincipal类psented $ P $的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 08:19