我试图获取 Active Directory 的类和属性列表。
DirectoryEntry entry = new DirectoryEntry(
"LDAP://CN=Schema,CN=Configuration,DC=addomain,DC=com",
null, null, AuthenticationTypes.Secure);
ActiveDirectorySchema schema = ActiveDirectorySchema.GetCurrentSchema();
ActiveDirectorySchemaClass User = schema.FindClass("account");
foreach (ActiveDirectorySchemaProperty property in User.GetAllProperties())
{
Console.WriteLine("{0}", property.Name);
}
这将返回指定类的所有属性。如何获取 Active Directory 中存在的所有类?
相关分类