大网数据广告活动
域与目录服务

Choosing the Search Technology

· 52CE 我爱测

This topic includes a list of technologies used to search Active Directory.

The technologies, listed in the following table, can be used to search in Active Directory Domain Services.

Technology Description
DirectorySearcher The DirectorySearcher class is provided by the System.DirectoryServices namespace to allow searching within Active Directory Domain Services with .NET Framework. For more information, see Searching the Directory.
IDirectorySearch ADSI provides the IDirectorySearch interface to query an Active Directory server, as well as other directory services such as NDS, using LDAP. IDirectorySearch is a COM interface that returns richly typed data, such as Integer, Octet String, String, Security Descriptor, UTC-Time, Large Integer, or Boolean. For more information about how to use IDirectorySearch, see Searching With the IDirectorySearch Interface.
OLE DB OLE DB is a set of COM interfaces that provide applications with uniform access to data stored in diverse data sources, regardless of location or type. ADSI also provides an OLE DB provider for ADSI that enables applications to use OLE DB to access Active Directory Domain Services. The ADSI OLE DB provider uses the IDirectorySearch interfaces to submit queries to Active Directory Domain Services and to collect the results.
ADO and other OLE DB-based data access technologies The ADSI OLE DB provider enables any data-access technology based on OLE DB, such as ADO, to search within Active Directory Domain Services.
LDAP API Windows 2000 domain controllers are directory servers that are compliant with LDAP version 3. The LDAP API is a C-style function library. Applications can use the LDAP API to search within Active Directory Domain Services.

Consider the following when choosing a technology:

  • For Microsoft Visual Basic and Visual Basic Scripting Edition (VBScript), ADO is recommended.
  • For C/C++, you can choose any of the technologies.
  • If your application extensively uses ADSI, it may be simpler to use IDirectorySearch. If you use IDirectoryObject to manage objects in Active Directory Domain Services, use IDirectorySearch to make handling the properties returned from the search easier. IDirectorySearch uses the same ADSVALUE structures as IDirectoryObject to represent properties. In addition, IDirectorySearch is exposed on almost all ADSI COM objects. If you have a pointer to an ADSI COM object, you can call QueryInterface to get an IDirectorySearch pointer that you can use to perform a search starting at the directory object represented by the ADSI COM object.
  • If your application already uses OLE DB, ADO, or LDAP API, you can continue to use those technologies to search within Active Directory Domain Services.
  • If your application must join data from an Active Directory Domain Service and a SQL Server 7 database, use OLE DB. By using OLE DB, your application can perform distributed queries that reference Active Directory Domain Services and tables and rowsets from one or more Microsoft SQL Server 7 databases.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。