+ Post New Thread
Results 1 to 4 of 4
Cloud Services Thread, PowerShell export only Primary addresses in Technical; I am trying to export a CSV from Office365 of just primary email address ( i.e. the one that should ...
  1. #1

    Join Date
    May 2011
    Location
    Jus North of London, close but not too close
    Posts
    865
    Thank Post
    193
    Thanked 73 Times in 68 Posts
    Rep Power
    50

    PowerShell export only Primary addresses

    I am trying to export a CSV from Office365 of just primary email address ( i.e. the one that should be the reply adddress )

    I have PowerShell command that exports email addresses but this does not tell me the primary address i.e. the first email address is not necessarily the primary address as I found checking one user.

    Anyone know a specific switch to give me just the primary email address.

    Thanks

  2. #2
    ascott2's Avatar
    Join Date
    Nov 2007
    Posts
    184
    Thank Post
    18
    Thanked 38 Times in 30 Posts
    Rep Power
    21
    I'm not entirely sure that O365 is the same as on premise exchange but in Exchange it's just Get-Mailbox <user> | Select PrimarySMTPAddress
    Last edited by ascott2; 24th July 2014 at 11:27 AM. Reason: Typo

  3. Thanks to ascott2 from:

    Davit2005 (24th July 2014)

  4. #3

    EduTech's Avatar
    Join Date
    Aug 2007
    Location
    Reading
    Posts
    5,074
    Thank Post
    160
    Thanked 937 Times in 731 Posts
    Blog Entries
    3
    Rep Power
    275
    Quote Originally Posted by Davit2005 View Post
    I am trying to export a CSV from Office365 of just primary email address ( i.e. the one that should be the reply adddress )

    I have PowerShell command that exports email addresses but this does not tell me the primary address i.e. the first email address is not necessarily the primary address as I found checking one user.

    Anyone know a specific switch to give me just the primary email address.

    Thanks
    Hi,

    If you want to do this using the Exchange Module, Then you can use the following command:

    Get-Mailbox | fl DisplayName, PrimarySMTPAddress
    or if you want grid view

    Get-Mailbox | Select DisplayName, PrimarySMTPAddress | Out-GridView
    or, if you want to use the MSOL Commands:

    Get-MSOLUser | Select -Expand Proxyaddresses | ? {$_ -cmatch '^SMTP\:.*'}
    I hope that helps,
    James.

  5. Thanks to EduTech from:

    Davit2005 (24th July 2014)

  6. #4

    Join Date
    May 2011
    Location
    Jus North of London, close but not too close
    Posts
    865
    Thank Post
    193
    Thanked 73 Times in 68 Posts
    Rep Power
    50
    Thankyou both,

    The script I used for anyone else benefit is

    Get-Mailbox -ResultSize Unlimited | Select PrimarySMTPAddress | Export-Csv FILEPATH.csv -NoTypeInformation



SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 0
    Last Post: 5th November 2013, 08:29 PM
  2. Replies: 0
    Last Post: 11th April 2011, 04:18 PM
  3. Replies: 3
    Last Post: 30th January 2010, 01:03 PM
  4. Send email to one address only
    By rhyds in forum Windows
    Replies: 8
    Last Post: 3rd March 2008, 02:56 PM
  5. Locking down network, allow only approved mac addresses?
    By starscream in forum Wireless Networks
    Replies: 15
    Last Post: 19th July 2007, 02:06 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •