Active Directory属性列表使用C# [英] Active Directory Attribute List Using c#

查看:128
本文介绍了Active Directory属性列表使用C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是如何得到egcn,使用C#邮件等(ieall属性特定用户的不)的Active Directory用户属性的列表?

How i get the list of active directory user attributes(not of particular user i.e.all attributes) e.g.cn,mail etc. using c#?

推荐答案

如果你在.NET 3.5及以上,你需要检查出类 System.DirectoryServices.ActiveDirectory 这一点。你需要看一下类,如<一href="http://msdn.microsoft.com/en-us/library/system.directoryservices.activedirectory.activedirectoryschema.aspx"相对=nofollow> ActiveDirectorySchema 和<一href="http://msdn.microsoft.com/en-us/library/system.directoryservices.activedirectory.activedirectoryschemaclass.aspx"相对=nofollow> ActiveDirectorySchemaClass

If you're on .NET 3.5 and up, you need to check out the classes in System.DirectoryServices.ActiveDirectory for this. You need to look at classes like ActiveDirectorySchema and ActiveDirectorySchemaClass.

您可以通过掌握当前AD架构的:

You can get hold of the current AD schema by using:

ActiveDirectorySchema currSchema = ActiveDirectorySchema.GetCurrentSchema();

当您在当前的模式,您可以检查各种类的定义,如:

When you have the current schema, you can inspect the various class definitions, e.g.:

ActiveDirectorySchemaClass userSchema = currSchema.FindClass("person");

一旦你的对象,就可以检查和枚举它的属性,这样的事情:

Once you have that object, you can inspect and enumerate its properties, things like:

  • MandatoryProperties
  • OptionalProperties

等来获得洞察AD架构。

and so on to get an insight into the AD schema.

这篇关于Active Directory属性列表使用C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆