What Is ADSI?


You've seen one way to access the directory ”by using the CDO library. CDO provides a set of objects that allow you to query information stored in the Exchange Server directory under the AddressEntry section of the CDO hierarchy. Another way to access Exchange Server information stored in Active Directory is to use Microsoft Active Directory Services Interfaces (ADSI).

ADSI is a set of COM interfaces that allow you to manipulate objects in different directories, including Exchange Server 5.5 and Active Directory. ADSI supports such protocols as Lightweight Directory Access Protocol (LDAP), NetWare Directory Services (NDS), and Microsoft Windows NT Directory Services (NTDS). The advantage of ADSI is that its design isn't based on a specific directory's API, which makes it flexible in the type and number of directories it can work with. Also, ADSI can be used with multiple programming languages, such as Microsoft Visual Basic, Microsoft Visual Basic Scripting Edition (VBScript), Java, and Microsoft Visual C++.

start sidebar
Accessing the Directory: CDO or ADSI?

The big question is how to access the information provided by Active Directory. CDO offers you a limited subset of features ”it can access only the properties that have corresponding Messaging API (MAPI) unique IDs. Therefore, if CDO provides access to the directory properties that you need in your application, you should use it for directory access. Using CDO has the benefit of allowing you to write your application using a familiar object library, and you do not have to write to a second object library, which can save debugging time.

Another way to access Active Directory is by using the ADSI object library, which gives you more flexibility. Using ADSI, you can access not only the properties used by CDO but also other properties stored in Active Directory ”for example, configuration information, such as which protocols are enabled on the Exchange Server, user information, and computer information.

end sidebar
 

Design Goals of the ADSI Object Library

The ADSI library is the strategic library for accessing directory objects and information from Microsoft, whether this information is in Exchange Server or in Active Directory. When designing ADSI, Microsoft had three primary goals in mind. First, ADSI had to be based on COM-compatible providers to access directory information. In a provider-based model, the client interacts with the COM interfaces exposed by the ADSI library, and the installed providers convert the calls in the interfaces into function calls that access the targeted directory provider. The provider model allows the same calls to be used in an ADSI client application to access any type of directory with an ADSI provider. ADSI ships with four primary directory providers: a Microsoft Windows NT directory provider for Windows NT 4.0, a Novell NDS provider, a Novell NetWare Binding provider for NetWare versions before 4. x , and an LDAP provider. You can also write your own provider because the ADSI provider architecture is extensible. We will focus on the built-in LDAP provider in this chapter because it supports accessing and updating Active Directory.

Microsoft's second goal for ADSI was to allow developers to use any COM-based or .NET-based development tool with the object library, including Visual Basic, Visual C#, Visual C++, Java, VBScript, and JavaScript. You can decide which tool is the best for creating your ADSI Exchange Server applications. In this chapter, I use VBScript and Microsoft Active Server Pages (ASP) to create a Web-based administrator program for Exchange Server. However, this application could easily have been written in Visual Basic or Visual C#. Near the end of this chapter, you'll find information on .NET and Web services support for ADSI.

The third goal of ADSI was to provide a single directory API as a replacement for multiple directory APIs. With Exchange Server, you can use CDO to access information stored in Active Directory. With Active Directory, you can use LDAP functions to access information stored in Active Directory. However, depending on your application, it might be easier to write to a single set of interfaces and use different providers for these directory services rather than learn two or three different APIs. With ADSI, you need to learn only one API to use a multitude of directory services.




Programming Microsoft Outlook and Microsoft Exchange 2003
Programming MicrosoftВ® OutlookВ® and Microsoft Exchange 2003, Third Edition (Pro-Developer)
ISBN: 0735614644
EAN: 2147483647
Year: 2003
Pages: 227
Authors: Thomas Rizzo

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net