How to Programmatically Create a GAL in Exchange 2000 Server (300121)
The information in this article applies to:
- Microsoft Windows 2000 Server
- Microsoft Windows 2000 Advanced Server
- Microsoft Exchange 2000 Server
- Microsoft Active Directory Services Interface, System Component
This article was previously published under Q300121 SUMMARY
This article includes Microsoft Visual Basic sample code that demonstrates how to programmatically create a global address list (GAL) in Exchange 2000 Server.
Background
An Exchange 2000 Server GAL is an Active Directory object that exists in the Configuration Namespace of the Active Directory. To create a GAL, you must create an addressBookContainer class object in the directory under the following object:
CN=All Global Address Lists,CN=Address Lists Container,CN=Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=DomainName,DC=com
GALs, unlike address lists, cannot be nested and should be created in the All Global Address Lists container.
To enable Messaging Application Programming Interface (MAPI) clients to use a GAL, you must add the Distinguished Name of the newly created GAL to the globalAddressList attribute on the Microsoft Exchange container.
You must set the following attributes on a GAL object before your first call to SetInfo when you create the object:
- displayName (mandatory): A single-valued directory string attribute that stores the display name for this GAL.
- systemflags (optional): A single-valued integer attribute that stores system information regarding the directory object. To set this attribute, pass one or more logically OR'd values as defined by the ADS_SYSTEMFLAG_ENUM enumeration, documented at the following MSDN Web site:NOTE: Although the preceding attribute is marked optional, you must set it at object-creation time before the first SetInfo call.
You must also set the following optional attributes:
- purportedSearch (optional): A single-valued directory string attribute that stores the search query filter for this GAL.
- msExchPurportedSearchUI (optional): A multi-valued attribute that stores the parameters necessary to rebuild the Exchange System Manager's (ESM) Find Exchange Recipients dialog box. This attribute does not need to be set; however, without a value, the Modify button on the General tab of your GAL's Properties dialog box is not available (dimmed).NOTE: This attribute is not documented; therefore, when you set it programmatically, this action is not supported. The best way to set this attribute is to actually create an address list with a similar query filter from ESM. Then, copy the value of the msExchPurportedSearchUI attribute for this newly-created address list, and then paste it into the msExchPurportedSearchUI attribute for the GAL that you are creating programmatically.
REFERENCES
For more information about security on Active Directory objects, browse to the following Microsoft Web sites:
For additional information about Active Directory security issues, click the article number below
to view the article in the Microsoft Knowledge Base:
269159 HOWTO: Use Visual Basic and ADsSecurity.dll to Properly Order ACEs in an ACL
For more information about Active Directory Client Extensions, browse to the following Microsoft Web site:
For additional information about hosting with Exchange 2000 Server, click the article number below
to view the article in the Microsoft Knowledge Base:
262183 XGEN: Hosting with Microsoft Exchange 2000 Server
Modification Type: | Minor | Last Reviewed: | 3/19/2004 |
---|
Keywords: | kbDSWADSI2003Swept kbDSWADSI2003Swept kbhowto kbinfo KB300121 |
---|
|