Active Directory Domain Services Current Domain Technology Sample

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

This sample demonstrates how to connect to the currently logged-in domain using an LdapConnection. 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 Exceptions\CS directory.

  2. Type msbuild printdomain.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 printdomain and press Enter.

Note Note

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

This application issues a RootDSE search to the currently logged-in domain to find the fully qualified domain name, and displays it as shown in the following example:

Your domain is: