activedirectory中获取所有用户和extention

activedirectory中获取所有用户和extention

本文介绍了如何在activedirectory中获取所有用户和extention属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用

System.DirectoryServices.AccountManagement;

For one user i am using:

  public UserPrincipal GetUser(string username)
        {
            PrincipalContext context = GetPrincipalContext();

            UserPrincipal UserPrincipal =
               UserPrincipal.FindByIdentity(context , sUserName);
            return UserPrincipal;
        }





其次,



我怎样才能得到特定用户的延伸价值如



extentionattribute9使用



secondly,

How can i get the extention attibute value of specific user like

extentionattribute9 by using

System.DirectoryServices.AccountManagement;





因为我得到的用户不包含上述功能中的扩展属性值。



我尝试过:





because the user i get does not contain the extention attributes value in above function.

What I have tried:

public UserPrincipal GetUser(string username)
        {
            PrincipalContext context = GetPrincipalContext();

            UserPrincipal UserPrincipal =
               UserPrincipal.FindByIdentity(context , sUserName);
            return UserPrincipal;
        }

推荐答案


这篇关于如何在activedirectory中获取所有用户和extention属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 16:46