6.13. Enumerating Connected Mailboxes in a Database
Problem
You want to find out which mailboxes are in a specific mailbox database.
Solution
Using a graphical user interface
Launch the Exchange System Manager (Exchange System Manager.msc).
In the left pane, expand the appropriate Administrative Groups container, and then expand the Servers container.
Expand the server that contains the target database, then expand the parent SG.
Expand the mailbox database whose contents you want to see.
Select the Mailboxes node in the left pane of ESM. All mailboxes will be listed in the right pane.
If you want to save the list of mailboxes to disk as either an ASCII or comma-separated value file, right-click the Mailboxes folder and select Export List, then specify where you want the file saved.
Using a command-line interface
The following command lists all the mailboxes in a mailbox store:
> dsquery * forestroot -scope subtree -filter "(homeMDB=<mailboxStoreDN>")For example:
> dsquery * forestroot -scope subtree -filter "(homeMDB=CN=First Storage Group,
CN=InformationStore,CN=BATMAN,CN=Servers, CN=First Administrative Group,
CN=Administrative Groups,CN=Robichaux and Associates, CN=Microsoft
Exchange,CN=Services,CN=Configuration,DC=robichaux,DC=net)"However, this query runs much faster on Windows Server 2003 Active Directory domains, because Windows Server 2003 can do implict indexing of multilinked values. If you're using Windows 2000 Active Directory, you can get the same data (in a slightly different ...