Exchange 2007 shell commands for dist groups, contacts, forwards etc

Netexperts
Netexperts used Ask the Experts™
on
Hi Guys,

I need to get a list of
1.ALL distribution groups in an Exchange 2007 env with ALL members and email addresses of the dist group.
2. ALL users that have forwarders on their mailboxes.
3. ALL email addresses on each mailbox.

Can anyone give me the shell commands for these ?

This might seem lazy but i can't find these commands anywhere.

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Sr. Infrastructure Specialist
Commented:

For 1 you can use DSget. In the below command give the correct CN Name of the OU of the Group

dsget group "CN=,OU=,dc=Domain,dc=com" -members > c:\members.txt

Open in new window

For 2 and 3 it is better you use Active Directory LDAP queries and then you can even export it .csv format.

2. ALL users that have forwarders on their mailboxes.
 
(&(objectCategory=person)(objectClass=user)(mail=*)(altRecipient=*))

Open in new window


3.ALL email addresses on each mailbox.

(&(objectClass=user)(mail=*))

Open in new window


After doing the LDAP query you should be able to see the e-mail address column. If not you can add the column from the View option.

Author

Commented:
Sorry for the late reply but thanks.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial