获得ADLDS级的所有可写性 [英] Get all writeable properties of an ADLDS-Class

查看:325
本文介绍了获得ADLDS级的所有可写性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发可以与MS-ADLDS-服务处理的应用程序。 目前,它可以创建目录的条目,并赋值给某些属性。 不是真的令人兴奋的任务,直到这样的:

I'm developing an application which can deal with a MS-ADLDS-Service. Currently it is possible to create Directory-Entries and assign values to some properties. Not a realy exciting task until this:

林我的应用程序有可能(应该是)来配置哪些类的属性(比如:CN = Person类)。应与它们在运行时在我的应用评估值被分配

Im my application it's possible (it should be) to configure which properties of a class (for instance: the CN=Person class) should be assigned with values which are evaluated at runtime in my application.

长话短说: 我要检索类的所有(写)的属性。如果没有创建和之前保存新的CN =人-对象。

目前我用我的SCHEMABINDING来获取目录-的classSchema入境的人 - 类(CN =人),从那里我看了一些属性值(如AllowedAttributesEffective,mayContain中都未,AllowedAttributes) - 我获得最大的性能通过这样的方式 - 但有些属性丢失!比如在telephoneNumber-Property(的attributeSchema:CN =电话号码)

Currently i use my schemaBinding to get the Directory-classSchema-Entry of the Person-Class (CN=Person) from where i read some property-values (like "AllowedAttributesEffective", "mayContain", "AllowedAttributes") - i get the most properties by this way - but some Properties are missing! For instance the "telephoneNumber"-Property (attributeSchema: CN=Telephone-Number)

有谁知道如何获得一个类的这些属性? ADSI,编辑做到这一点:当我创建一个新的对象,使用ADSI编辑,我可以提交新条目之前赋值给所有可能的属性。

Does anybody know how to get these properties of a class? ADSI-Edit does this: when i create a new object with adsi-edit i can assign values to all possible properties before committing the new entry.

非常感谢任何暗示!

(净code是欢迎的)

(.net code is welcome)

推荐答案

我已经找到了解决方案,我的任务!

I have found the solution for my task!

其中一些属性是计算,而不是持续性的的DirectoryEntry。 因此,它的意思是叫 RefreshCache()方法,并通过所需要的属性名称作为一个字符串数组。

Some of these properties are "calculated" and not persistent at the directoryentry. So its meant to call the RefreshCache() Method and pass the needed property names as an string array.

directoryEntry.RefreshCache(new string[] { "allowedAttributesEffective",
                                            "allowedAttributes",
                                            "systemMayContain",
                                            "systemMustContain" });

这是调用后,性能有价值观......

After that call, the properties have values....

if (directoryEntry.Properties["systemMayContain"]).Value != null)
   {
    /// Success
   }

这篇关于获得ADLDS级的所有可写性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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