none
EXchange 2010 EMS command for just a list of email addresses

    Question

  • Hi all.  I have zero EMS experience, yet need to put a text file a list of all email addresses.  I don't even know the syntax yet but I figure it's this or similar:

    get-mailbox | FL "somehow filter on smtpaddress" ?  > c:\list.txt

    Scripts and all that PS1 stuff is way too complicated for me right now, unless of course that's the only way to get htis done.  This needs to be a list solely with email addresses for the users, so I can send it to a 3rd party message hygiene service.  Maybe if there's a way to also do this as a .csv file?  Txt is also ok - though I do not know if it needs to be comma seperated or not. 

    Thank you. 

    Wednesday, July 24, 2013 8:35 PM

Answers

  • Hi,

    Here you go..

    Get-Mailbox -Resultsize Unlimited | Ft Name, PrimarySmtpAddress | Export-Csv C:\emailaddress.csv


    Kottees : My Blog : Please mark it as an answer if it really helps you.

    • Proposed as answer by tonyholdgate Wednesday, July 24, 2013 10:20 PM
    • Marked as answer by viProCon Thursday, July 25, 2013 1:04 PM
    Wednesday, July 24, 2013 8:42 PM

All replies

  • Hi,

    Here you go..

    Get-Mailbox -Resultsize Unlimited | Ft Name, PrimarySmtpAddress | Export-Csv C:\emailaddress.csv


    Kottees : My Blog : Please mark it as an answer if it really helps you.

    • Proposed as answer by tonyholdgate Wednesday, July 24, 2013 10:20 PM
    • Marked as answer by viProCon Thursday, July 25, 2013 1:04 PM
    Wednesday, July 24, 2013 8:42 PM
  • Hi,

    Start here to learn powershell.

    http://technet.microsoft.com/en-us/library/ee177003.aspx

    And there are plenty of stuff available over the net for powershell.

    Good Luck for the Learning.


    Kottees : My Blog : Please mark it as an answer if it really helps you.

    Wednesday, July 24, 2013 8:45 PM
  • Hello,

    From your description, we are clear that just an email address list is needed for users. The Get-Mailbox cmdlet retrieves the attributes and objects for a mailbox.

    As Imkottees answers, it can help you to get the address list. What should be noticed is that you need to be assigned permissions before you can run this cmdlet.

    Besides, there is some helpful information about EMS in the following links:

     1. White Paper: Exchange Management Shell.

         http://technet.microsoft.com/zh-cn/library/bb266977(v=EXCHG.80).aspx

     2. Exchange Management Shell in Exchange 2010.

         http://technet.microsoft.com/en-us/library/bb123778(v=exchg.141).aspx

     3. Exchange 2010 Cmdlets.

         http://technet.microsoft.com/en-us/library/bb123778(v=exchg.141).aspx

    Hope it can help you.

    thanks

    Thursday, July 25, 2013 12:48 PM
  • Hi guys, thanks for the links.  I have plans to learn EMS and PS v2 when time permits but just needed the list for now for a customer.  The one provided was close, but it was weird because after running it, the .csv file was just full of what almost appeared to be hash values for table entries.  Instead of:

    user@domainname.com

    I got something like:

    7aabcd11329033...

    Not sure why, so instead I ran:

    Get-Mailbox | -resultsize unlimited | FT PrimarySmtpAddress > c:\list.txt

    This cuts bypassed the odd formatting issues I ran into and also the strange conversion of addresses to that odd hex-like format. 

    But the important point is that the initial Get-Mailbox suggestion is what got me started so thank you for that and also the followup information from both of you. 

    Thursday, July 25, 2013 1:02 PM