DirectoryEntry root = new DirectoryEntry ( "IIS: // localhost / w3svc", "administrator", "2040601", AuthenticationTypes.Secure & AuthenticationTypes.ServerBind); DirectorySearcher searcher = new DirectorySearcher (root);
The program jump box says that the provider does not support search operation, so IIS: // localhost / W3SVC cannot be searched
System.directoryServices Namespace provides simple access from the Managed program code to Active Directory. Namespace contains two component categories: DirectoryEntry and DirectorySearcher, which use Active Directory Services Interface (ADSI) technology. ADSI is a group of Microsoft provides an elastic tool for use with a variety of network providers. Regardless of the size of the network, ADSI can reduce the system administrator to find and manage the burden on network resources.
The category in this namespace can be used with any Active Directory service provider. The current providers include Internet Information Services (IIS), Lightweight Directory Access Protocol (LDAP), Novell NetWare Directory Service (NDS), and Winnt.
ADSI is the programming interface of Microsoft Active Directory, which can make your app to interact with multiple directories on the Internet using a single interior. Using ADSI, you can create an application that can perform general work, such as backup database, access printing machine, and managing user accounts.
It assumes that you have a general understanding of Active Directory before using these categories. For more information on Active Directory, see the Active Directory item introduction, Active Directory technology background and an Active Directory topic in MSDN Library (Msdn.microsoft.com):
Active Directory Programmers Guide Active Directory Service Interfaces Lightweight Directory Access Protocol API ADSI System Providers WinNT Binding String Binding IADsOpenDSObject :: OpenDSObject Active Directory is a tree structure. Each node in the tree structure contains a set of properties. Use this namespace to round-trip, search and modify the tree structure, and read the properties of the written node.
The DirectoryEntry category encapsulates nodes or objects in the Active Directory class architecture. Use this category to be tuned to the object, read properties, and update properties (Attribute). Collaborative Helper categories, DirectoryEntry provides retention cycle management and inspection methods, including establishment, deletion, renaming, removing child nodes, and listing subsystems.
Use the DirectorySearcher category to perform queries for the Active Directory class architecture. LDAP is the only system that provides an Active Directory Service Interfaces (ADSI) provider (support search).