Need a query to export all the Distribution Lists on a Windows 2003 AD with Exchange 2003

emelnik used Ask the Experts™

I need a query or script that can help me get Distribution Lists the following information on a Windows 2003 AD with Exchange 2003:

1 .Export all existing DL's
2. Attributes: DL displayname, DL internal and external email addresses, DL cn
3. User memberships: username, email address, cn, displayname
4. Owner permissions: username, email address, cn, displayname
5. SendAS permissions: username, email address, cn, displayname
6. Restricted users: username, email address, cn, displayname
7. Restricted groups: group email address, cn, displayname

Any help is greatly appreciated.

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
install powershell and the quest ActiveRoles management shell for active directory
then you would need a script or two to get this like the following to get 1 and 2

Get-QADGroup -GroupType Distribution | Select DisplayName,EmailAddresses,CanonicalName

for #3
Get-QADGroup -GroupType Distribution | Get-QADGroupMember | Select SamAccountName,Email,CanonicalName,DisplayName

for #4
Get-QADGroup -GroupType Distribution | Get-QADUser $_.ManagedBy | Select SamAccountName,Email,CanonicalName,DisplayName

this should get you in the direction you need
Get-QADGroup  -GroupType Distribution  | Get-QADPermission -inherited | Where { $_.RightsDisplay -eq "Send As" }



I have Exchange 2003 not Exchange 2007.
CompTIA Security+

Learn the essential functions of CompTIA Security+, which establishes the core knowledge required of any cybersecurity role and leads professionals into intermediate-level cybersecurity jobs.

it doesn't matter. this tool from quest will query active directory


Tried the quest tool but I never got it to work the way I need it, got outputs like this:

DisplayName                             EmailAddresses                          CanonicalName                          
-----------                             --------------                          -------------                          
ld email                                {, smtp:lde...
Ld 7874 Servicio a Clientes             {SMTP:Ld7874ServicioaClientes@cfmex....

Don't know how to get rid of the "..." and get the full output on a csv format.

What I need is a csvde command like the one below:

csvde -f c:\temp\DistributionLists -p subtree -l "cn,mail,displayName" -r (&(objectCategory=Group)(objectClass=Group)(|(groupType=8)(groupType=4)(groupType=2))) -j c:\temp

Can you help?
getting all email addresses for an object is trickier, but for any of the commands you can add the following to get them in csv format

| export-csv <path>\<filename>.csv


Pointed me in the direction to solve my problem.

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