DirectoryEntry.SchemaClassName Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets the name of the schema class for this DirectoryEntry object.

Namespace:   System.DirectoryServices
Assembly:  System.DirectoryServices (in System.DirectoryServices.dll)

Public ReadOnly Property SchemaClassName As String

Property Value

Type: System.String

The name of the schema class for this DirectoryEntry object.

This is the same as the Name property of the SchemaEntry property.

A DirectoryEntry object's schema defines its properties and methods.

The following example demonstrates the SchemaClassName and SchemaEntry properties of the DirectoryEntry class. This example gets the user-specified DirectoryEntry and gets all of its children if the SchemaEntry is a container object. The SchemaEntry is a container object if the Name of that object is "container".

Dim myADSPath As String = "LDAP://onecity/CN=Users,DC=onecity,DC=corp,DC=fabrikam,DC=com"

' Creates an Instance of DirectoryEntry.
Dim myDirectoryEntry As New DirectoryEntry(myADSPath, UserName, SecurelyStoredPassword)

' Display the 'SchemaClassName'.
Console.WriteLine("Schema class name:" + myDirectoryEntry.SchemaClassName)

' Gets the SchemaEntry of the ADS object.
Dim mySchemaEntry As DirectoryEntry = myDirectoryEntry.SchemaEntry

If String.Compare(mySchemaEntry.Name, "container") = 0 Then
   Dim myChildDirectoryEntry As DirectoryEntry
   For Each myChildDirectoryEntry In  myDirectoryEntry.Children

.NET Framework
Available since 1.1
Return to top