Powershell Command - email address for all users in a group

need to export all the email addresses in a Active directory Group to csv
LVL 2
Jorge OcampoAsked:
Who is Participating?
 
Rajitha ChimmaniCommented:
Use this to avoid the warning

Get-DistributionGroupMember groupname -Resultsize unlimited | Select PrimarySMTPaddress | export-csv filepath -notypeinformation
0
 
Rajitha ChimmaniCommented:
Run the below command in Exchange Management shell

Get-DistributionGroupMember groupname | Select PrimarySMTPaddress | export-csv filepath -notypeinformation
0
 
Jorge OcampoAuthor Commented:
what does the last "-notypeinformation" do?
0
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

 
Jorge OcampoAuthor Commented:
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.
0
 
Rajitha ChimmaniCommented:
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.
0
 
NVITCommented:
Maybe these will help to export those addresses:

Powershell Script to export AD user to a CSV file?
http://www.experts-exchange.com/Programming/Languages/Scripting/Powershell/Q_28356892.html

Powershell: Export active users' firstname, lastname & email address to CSV
http://www.experts-exchange.com/Software/Server_Software/Active_Directory/Q_28022171.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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.