Article ID: 203019 - Last Review: July 13, 2004 - Revision: 2.4 How To Use CDO (1.x) to Loop Through All Mailboxes in the GALThis article was previously published under Q203019 SUMMARY
Using CDO (1.2, 1.21), you can obtain a list of mailboxes from the Global Address List (GAL), and then using the ProfileInfo parameter of the Session.Logon method, you can loop through all of the mailboxes. Within that loop, you can either get information from the mailbox or perform maintenance on the mailboxes. This article demonstrates how to do this.
MORE INFORMATIONNOTE: To be able to log onto each mailbox, you must have sufficient permissions on each of the mailboxes. The section of the code that retrieves the mailbox names from the GAL needs permission only to view the GAL (as noted in the code), which most users can do. The section of code that loops through the mailboxes in the array needs Service Account Administrator or greater permissions. Service Account Administrator permissions are required due to the fact that the application logs on to all of the mailboxes. Required permissions may also depend on what actions are being performed on each mailbox.
Here are the steps to create an application that will logon to all of the mailboxes in the Global Address List:
REFERENCES
For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base:
171440
(http://support.microsoft.com/kb/171440/
)
INFO: Where to acquire the CDO libraries (all versions)
177851
(http://support.microsoft.com/kb/177851/
)
How To Build a CDO (1.x) messaging application to run from a service
200018
(http://support.microsoft.com/kb/200018/
)
INFO: Differences between CDO, Simple MAPI, and Extended MAPI
262054
(http://support.microsoft.com/kb/262054/
)
XADM: How to get service account access to all mailboxes in Exchange 2000
291169
(http://support.microsoft.com/kb/291169/
)
OL2002: General information about CDO 1.21s
| Article Translations
|

Back to the top
