Platform SDK: Active Directory, ADSI, and Directory Services |
You can use the following technologies to search Active Directory:
Which one do you choose?
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, 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 simply 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 Active Directory as well.
If your application needs to join data from Active Directory and a SQL Server 7 database, use OLE DB. By using OLE DB, your application can perform distributed queries that reference Active Directory and tables and rowsets from one or more Microsoft SQL Server 7 databases.