Solved

Powershell Command - email address for all users in a group

Posted on 2014-12-11
6
197 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

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

Question has a verified solution.

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

This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
This article demonstrates probably the easiest way to configure domain-wide tier isolation within Active Directory. If you do not know tier isolation read https://technet.microsoft.com/en-us/windows-server-docs/security/securing-privileged-access/s…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

730 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