Link to home
Start Free TrialLog in
Avatar of Jorge Ocampo
Jorge OcampoFlag for United States of America

asked on

Powershell Command - email address for all users in a group

need to export all the email addresses in a Active directory Group to csv
Avatar of Rajitha Chimmani
Rajitha Chimmani
Flag of United States of America image

Run the below command in Exchange Management shell

Get-DistributionGroupMember groupname | Select PrimarySMTPaddress | export-csv filepath -notypeinformation
Avatar of Jorge Ocampo

ASKER

what does the last "-notypeinformation" do?
i also got this message:

WARNING: By default, only the first 1000 items are returned. Use the ResultSize parameter to specify the n
items returned. To return all items, specify "-ResultSize Unlimited". Be aware that, depending on the actu
items, returning all items can take a long time and consume a large amount of memory. Also, we don't recom
the results in a variable. Instead, pipe the results to another task or script to perform batch changes.
Usually in csv output it gives you the attribute type in the first line. if you add this it would skip the type information which is not of any use.
ASKER CERTIFIED SOLUTION
Avatar of Rajitha Chimmani
Rajitha Chimmani
Flag of United States of America 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
Maybe these will help to export those addresses:

Powershell Script to export AD user to a CSV file?
https://www.experts-exchange.com/questions/28356892/Powershell-Script-to-export-AD-user-to-a-CSV-file.html

Powershell: Export active users' firstname, lastname & email address to CSV
https://www.experts-exchange.com/questions/28022171/Powershell-Export-active-users'-firstname-lastname-email-address-to-CSV.html

Export DisplayName, Email Address and Title From AD to CSV File:
http://community.spiceworks.com/how_to/show/86794-powershell-how-to-export-displayname-email-address-and-title-from-ad-to-csv-file