Recipe 5.12. Creating Multiple Address ListsProblemYou want to create separate address lists for subdivisions of your Exchange organization. SolutionUsing a graphical user interface
Figure 5-4. You can easily build a new global address list by finding selected combinations of contacts, users, public folders, and distribution groupsUsing VBScript' This code creates a new global address list ' ------ SCRIPT CONFIGURATION ------ strDCName = "<serverName>" ' e.g., CONT-EXBE01 strContainer= "/CN=All Address Lists,CN=Address Lists Container,CN=<orgName>," &_ "CN=Microsoft Exchange,CN=Services,CN=Configuration, <ForestRootDN>" strALName = "<addressListName>" ' e.g., "Seattle Employees" strDomain = "<domainPath>" ' e.g., "dc=robichaux, dc=net" ' ------ END CONFIGURATION --------- Set objContainer = GetObject("LDAP://" & strDCName & strContainer) Set objAddrList = objContainer.Create("AddressBookContainer", "cn=" & strALName) objAddrList.Put "displayName", strALName objAddrList.Put "PurportedSearch", "(&(mailNickname=*)(objectClass=user))" objAddrList.Put "systemFlags", 1610612736 objAddrList.SetInfo WScript.Echo " Created new GAL named " & strALName DiscussionAddress lists allow you to create flexible groupings of your users that are automatically updated. If you're familiar with recipient containers in Exchange 5.5, you'll recognize the underlying idea: define a rule that says which users should be grouped together, then let Exchange reassign users as necessary. Unlike 5.5 recipient containers (which didn't allow you to move users between them), address lists are based on LDAP queries, so the lists are dynamically assembled, and the original objects' attributes are mostly untouched. You can write arbitrarily complex LDAP filter expressions to define the contents of your address lists; ESM provides a fairly robust interface for creating canned queries, but you can plug in your own filter expression via the GUI or in a script. (Note that although LDAP queries are used to build the address lists, clients access them via the Name Services Provider Interface, or NSPI.) Once the address list has been created, the RUS will update it whenever it runs (which means that you may experience short propagation delays). If you leave the RUS schedule set to its default of "always run," then the RUS will be run whenever a recipient policy changes, which in turn means that your address lists will be updated when you change recipient policies. The RUS actually updates the showInAddressBook attribute to reflect each address list in which the object should be visible. You can verify the address list's presence in two ways: within ESM (although it may not appear until you quit and relaunch the snap-in) or by creating a new message in Outlook and clicking the To button, then using the Show names from the combo box to pick the new address list. When you create an address list via script, it is important that you create it in the correct container. The All Address Lists object is the immediate parent of all the address lists you define in the organization; in turn, that object lives in the Address Lists Container object, a child of the Exchange organization object. The value of the PurportedSearch attribute specifies your LDAP filter.
See AlsoRecipe 5.17 for hiding items from address lists, MS KB 319213 (How to Use Address Lists to Organize Recipients in Exchange Server 2003), MS KB 822940 (How to Manage Address Lists When You Host Virtual Organizations), and MS KB 253828 (How the Recipient Update Service Populates Address Lists) |