Solved

Powershell Command - email address for all users in a group

Posted on 2014-12-11
6
195 Views
Last Modified: 2014-12-11
need to export all the email addresses in a Active directory Group to csv
0
Comment
Question by:Jorge Ocampo
  • 3
  • 2
6 Comments
 
LVL 16

Expert Comment

by:Rajitha Chimmani
ID: 40494318
Run the below command in Exchange Management shell

Get-DistributionGroupMember groupname | Select PrimarySMTPaddress | export-csv filepath -notypeinformation
0
 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 40494334
what does the last "-notypeinformation" do?
0
 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 40494374
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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 16

Expert Comment

by:Rajitha Chimmani
ID: 40494377
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
 
LVL 16

Accepted Solution

by:
Rajitha Chimmani earned 500 total points
ID: 40494380
Use this to avoid the warning

Get-DistributionGroupMember groupname -Resultsize unlimited | Select PrimarySMTPaddress | export-csv filepath -notypeinformation
0
 
LVL 24

Expert Comment

by:NVIT
ID: 40494434
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

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
A brief introduction to what I consider to be the best editor for PowerShell.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question