DirectoryEntry is the primary class in System.DirectoryServices (SDS). It represents an object in the underlying connected directory. This object can be any type of object in the directory. Typically, it represents things like users, computers, groups, and containers. The majority of what we can accomplish with SDS relies on the use of DirectoryEntry in some manner or another.
In addition to what DirectoryEntry represents, it is solely responsible for all binding to connected directories and provides the security context with which to operate. Any changes or updates to the connected directories occur through use of DirectoryEntry, including the addition of new objects or the deletion of existing ones. SDS relies on DirectoryEntry for the vast majority of its heavy lifting.
This chapter is divided into roughly three parts. In the first part, we take a lap around the DirectoryEntry class and examine its properties, methods, and supporting classes. The second part of the chapter dives deep into the details of connecting to the directory and explains how the various available options work and affect the way the connection will behave. In the last part, we discuss how the standard create, read, update, and delete (CRUD) operations familiar to database developers are performed.
Property and Method Overview
Part I: Fundamentals
Introduction to LDAP and Active Directory
Introduction to .NET Directory Services Programming
Binding and CRUD Operations with DirectoryEntry
Searching with the DirectorySearcher
Advanced LDAP Searches
Reading and Writing LDAP Attributes
Active Directory and ADAM Schema
Security in Directory Services Programming
Introduction to the ActiveDirectory Namespace
Part II: Practical Applications
Part III: Appendixes
Appendix A. Three Approaches to COM Interop with ADSI
Appendix B. LDAP Tools for Programmers
Appendix C. Troubleshooting and Help