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

Searching Active Directory

· 52CE 我爱测

An important function of Active Directory is to resolve data queries for people, as well as configuration data for computers and services.

An important function of Active Directory is to resolve data queries for people, as well as configuration data for computers and services. To write efficient queries for Active Directory, it is helpful to be familiar with the following:

  • Determining the scope of the query: Must the client find properties for objects that might be located anywhere within a forest, or only within one domain, or within a given organizational unit (OU)?
  • Determining the depth of the query: Must the query only search one level or might it cross into other LDAP directories?
  • Performance and handling large result sets: How should the client effectively handle the potential of a large result set?
  • Determining the best queries: What type of queries provide the most efficient results? What type of queries should the developer avoid?
  • Understanding the query syntax: ADSI supports both the LDAP syntax as documented in RFC 2254, as well as a subset of SQL.
  • Choice of interfaces: ADSI provides both OLE DB support as well as a C/C++ interface called IDirectorySearch. Because ADSI works for multiple namespaces, you can use these interfaces for querying other namespaces such as Exchange, as well as Active Directory. Because the ActiveX Data Object (ADO) is a simple scriptable data access object model on top of OLE DB, the OLE DB interfaces work well for Visual Basic programmers and webpage script writers. The new data access features within Visual Studio and Office applications that take advantage of ADO and OLE DB can now access Active Directory data in the same way that they access data from other OLE DB providers, such as SQL Server. However, if a C/C++ developer must perform a simple directory search, the IDirectorySearch interface might be more appropriate than the OLE DB interfaces.

The following topics describe how to search Active Directory to ensure your application issues the most efficient query, given the requirements of the client:

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)

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

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