DirectoryEntry.SchemaEntry Property
.NET Framework 4
Gets the schema object for this entry.
Assembly: System.DirectoryServices (in System.DirectoryServices.dll)
[DSDescriptionAttribute("DSSchemaEntry")] [BrowsableAttribute(false)] public DirectoryEntry SchemaEntry { get; }
Property Value
Type: System.DirectoryServices.DirectoryEntryA DirectoryEntry object that represents the schema class for this entry.
The following example demonstrates the SchemaClassName and SchemaEntry properties of the DirectoryEntry class. This example gets the user-specified DirectoryEntry object and gets all of its children if the SchemaEntry object is a container object. The SchemaEntry is a container object if the Name of that object is "container".
String myADSPath = "LDAP://onecity/CN=Users,DC=onecity,DC=corp,DC=fabrikam,DC=com"; // Creates an Instance of DirectoryEntry. DirectoryEntry myDirectoryEntry=new DirectoryEntry(myADSPath, UserName, SecurelyStoredPassword); // Display the 'SchemaClassName'. Console.WriteLine("Schema class name:"+myDirectoryEntry.SchemaClassName); // Gets the SchemaEntry of the ADS object. DirectoryEntry mySchemaEntry = myDirectoryEntry.SchemaEntry; if (string.Compare(mySchemaEntry.Name,"container") == 0) { foreach(DirectoryEntry myChildDirectoryEntry in myDirectoryEntry.Children) Console.WriteLine(myChildDirectoryEntry.Path); }
-
DirectoryServicesPermission
To get the schema object.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.