LDAP Exceptions Technology Sample
This sample demonstrates LDAP exception handling. This sample is available only in Visual C#.
For information about using the samples, see the following topics:
To build the sample
Open a Command Prompt window and navigate to the Exceptions\CS directory.
Type msbuild exceptions.sln at the command line.
To run the sample
Navigate to the directory that contains the built executable file, using the command prompt.
Type exceptions followed by its arguments and press Enter.
This sample has the following syntax:
Exceptions <ldapServer> <user> <pwd> <domain>
- ldapServer
The LDAP server.
- user
Your user name.
- pwd
Your password.
- domain
The Active Directory domain.
Here is an example:
Exceptions.exe myDC1.testDom.fabrikam.com user1 secret@~1 testDom
Note |
---|
This sample is a console application. You must start and run it in a Command Prompt window to view its output. |
Remarks
This sample defines the following methods.
Method | Description |
---|---|
|
Connects to the server using a LdapConnection. |
|
Handles a connecting to an unknown LDAP server, and connecting using invalid credentials. |
|
Handles a delete request using an invalid distinguished name (DN). |
|
Handles an unsupported operating system. |
|
Handles decoding a binary value with an incorrect decode string. |
|
Handles creating directory attributes with null values. |
|
Handles TlsOperationException |
|
Handles anonymous authentication with a non-null credential. |