Link to home
Start Free TrialLog in
Avatar of whenz
whenz

asked on

Exchange PowerShell: List SMTP E-Mail address from a Distribution List in a defined format

I need to extract following information from a Distribution List:

 - Primary SMTP Address of ManagedBy object
 - All SMTP addresses of all members of the distribution list


then I need to have the following format of the output

--------------------------------------------------------output.txt--------------------------------------------------------
SMTPAddress1Member1 PrimarySMTPAddressOfManagedByObject
SMTPAddress2Member1 PrimarySMTPAddressOfManagedByObject
SMTPAddress3Member1 PrimarySMTPAddressOfManagedByObject
SMTPAddress1Member2 PrimarySMTPAddressOfManagedByObject
SMTPAddress2Member2 PrimarySMTPAddressOfManagedByObject
--------------------------------------------------------output.txt--------------------------------------------------------

Example output.txt file:

Mark.Henderson@gmail.com JunkAdmin1@gmail.com
M.Henderson@gmail.com JunkAdmin1@gmail.com
Mark.H@gmail.com JunkAdmin1@gmail.com
Lisa.Simpson@gmail.com  JunkAdmin1@gmail.com
L.Simpson@gmail.com  JunkAdmin1@gmail.com
Lisa.S@gmail.com  JunkAdmin1@gmail.com
Michael.Kight@gmail.com  JunkAdmin1@gmail.com
M.Kight@gmail.com  JunkAdmin1@gmail.com
Michael.K@gmail.com  JunkAdmin1@gmail.com

Open in new window



I know this sounds very tricky, but maybe someone coded this one already :-)

Thanks for any help!
Avatar of SubSun
SubSun
Flag of India image

By PrimarySMTPAddressOfManagedByObject, do you mean the PrimarySMTPAddress of the group?
Avatar of whenz
whenz

ASKER

No, I mean the primary SMTP Address of the ManagedBy Attribute.  Please see the attached example, I would need the primary SMTP address of user "povici"
EE-screenshot.jpg
ASKER CERTIFIED SOLUTION
Avatar of SubSun
SubSun
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of whenz

ASKER

Subsun you're a wizard, thank you indeed!!!