Compartir a través de


LDAP ReadRootDSE Technology Sample

This sample demonstrates reading the RootDSE object and printing its attributes. This sample is available only in Visual C#.

For information about using the samples, see the following topics:

To build the sample

  1. Open a Command Prompt window and navigate to the ReadRootDSE\CS directory.

  2. Type msbuild readrootdse.sln at the command line.

To run the sample

  1. Navigate to the directory that contains the built executable file, using the command prompt.

  2. Type readrootdse followed by the name of the server and press Enter.

For example:

readrootdse myDC1.testDom.fabrikam.com 
NoteNote

This sample is a console application. You must start and run it in a Command Prompt window to view its output.

Remarks

Each directory server has a unique entry called RootDSE. It provides data about the server, such as its capabilities, the LDAP version it supports, and the naming contexts it uses.

This sample defines the following methods.

Method Description

CreateConnection

Connects to the server using a LdapConnection.

ReadRootDSE

Sends a search request to read the root object, and lists the returned attributes and their values.