System.DirectoryServices Namespace

The System.DirectoryServices namespace provides easy access to Active Directory from managed code. The namespace contains two component classes, DirectoryEntry and DirectorySearcher, which use the Active Directory Services Interfaces (ADSI) technology. ADSI is the set of interfaces that Microsoft provides as a flexible tool for working with a variety of network providers. ADSI gives the administrator the ability to locate and manage resources on a network with relative ease, regardless of the network's size.

The classes in this namespace can be used with any of the Active Directory service providers. The current providers are: Internet Information Services (IIS), Lightweight Directory Access Protocol (LDAP), Novell NetWare Directory Service (NDS), and WinNT.

ADSI is a programmatic interface for Microsoft Active Directory that enables your applications to interact with diverse directories on a network, using a single interface. Using ADSI, you can create applications that can perform common tasks, such as backing up databases, accessing printers, and administering user accounts.

It is assumed that you have a general understanding of Active Directory before using these classes. For more information on Active Directory, see Introduction to Active Directory Objects, Active Directory Technology Backgrounder, and the Active Directory topics in the 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 contains a set of properties. Use this namespace to traverse, search, and modify the tree, and read and write to the properties of a node.

The DirectoryEntry class encapsulates a node or object in the Active Directory hierarchy. Use this class for binding to objects, reading properties, and updating attributes. Together with helper classes, DirectoryEntry provides support for life-cycle management and navigation methods, including creating, deleting, renaming, moving a child node, and enumerating children.

Use the DirectorySearcher class to perform queries against the Active Directory hierarchy. LDAP is the only system-supplied Active Directory Service Interfaces (ADSI) provider that supports searching.

A search of the Active Directory hierarchy through DirectorySearcher returns instances of SearchResult, which are contained in an instance of the SearchResultCollection class.

Namespace hierarchy

Classes

ClassDescription
DirectoryEntriesContains the children (child entries) of an entry in Active Directory.
DirectoryEntryEncapsulates a node or object in the Active Directory hierarchy.
DirectorySearcherPerforms queries against Active Directory.
DirectoryServicesPermissionAllows control of code access security permissions for System.DirectoryServices.
DirectoryServicesPermissionAttributeAllows declarative System.DirectoryServices permission checks.
DirectoryServicesPermissionEntryDefines the smallest unit of a code access security permission set for System.DirectoryServices.
DirectoryServicesPermissionEntryCollectionContains a strongly typed collection of DirectoryServicesPermissionEntry objects.
PropertyCollectionContains the properties of a DirectoryEntry.
PropertyValueCollectionContains the values of a DirectoryEntry property.
ResultPropertyCollectionContains the properties of a SearchResult instance.
ResultPropertyValueCollectionContains the values of a SearchResult property.
SchemaNameCollectionContains a list of the schema names that the SchemaFilter property of a DirectoryEntries object can use.
SearchResultEncapsulates a node in the Active Directory hierarchy that is returned during a search through DirectorySearcher.
SearchResultCollectionContains the SearchResult instances that the Active Directory hierarchy returned during a DirectorySearcher query.
SortOptionSpecifies how to sort the results of a search.

Enumerations

EnumerationDescription
AuthenticationTypesSpecifies the types of authentication used in System.DirectoryServices.
DirectoryServicesPermissionAccessDefines access levels used by System.DirectoryServices permission classes.
ReferralChasingOptionSpecifies if and how referral chasing is pursued.
SearchScopeSpecifies the possible scopes for a directory search.
SortDirectionSpecifies how to sort the results of an Active Directory query.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值