Directory Services

Setting Up Your Development Environment

This topic describes how to set up a Microsoft .NET project using System.DirectoryServices.

To use System.DirectoryServices

  1. Start Visual Studio .NET.
  2. Select File>New>Project.
  3. In the Project Type column, select the project type to create (C# or Visual Basic .NET).
  4. In the Template column, select a project template (Console Application, Windows Application, and so on).
  5. Name your project.
  6. Click OK to create your new project.
  7. Select Project>Add Reference...
  8. Select System.DirectoryServices.dll from the list as shown in the following screenshot.Add Reference Dialog Box
  9. Click OK to add the reference.
  10. Add the following line to your code.

    C#
    Using System.DirectoryServices;

    VB.NET
    Imports System.DirectoryServices

Note  Adding the namespace using statement to your code is unnecessary, but can simplify object names. If you do not add this statement, then you must declare an object as System.DirectoryServices.DirectoryEntry, instead of DirectoryEntry.