+ Post New Thread
Results 1 to 4 of 4
Enterprise Software Thread, Exporting email addresses to CSV for users in specific database - Exchange 2010 in Technical; Hi, I have been asked to give someone a list of all staff email addresses and I believe there is ...
  1. #1
    Darylrese's Avatar
    Join Date
    Sep 2010
    Posts
    445
    Thank Post
    10
    Thanked 7 Times in 6 Posts
    Rep Power
    10

    Question Exporting email addresses to CSV for users in specific database - Exchange 2010

    Hi,

    I have been asked to give someone a list of all staff email addresses and I believe there is a way to export them from exchange 2010 to a csv file. I have managed to export all users to a CSV using PowerShell, but how do I do it from a specific database only (staff)? Going through 1500+ users to pick staff out is going to be a nightmare. I need a way of extracting them from a specific database or organisational title.

    Is this possible?

    I tried this but it didn't work

    Get-Mailbox -Database "MCA-SR-EX1\MCA Staff.edb" -ResultSize Unlimited |Select-Object DisplayName,ServerName,PrimarySmtpAddress, @{Name=“EmailAddresses”;Expression={$_.EmailAddres ses |Where-Object {$_.PrefixString -ceq “smtp”} | ForEach-Object {$_.SmtpAddress}}} | Export-Csv c:\mailbox_alias.csv
    It returns an error relating to the database line (is not a valid value for the identity)
    Last edited by Darylrese; 15th August 2013 at 12:00 PM.

  2. #2


    Join Date
    May 2009
    Posts
    3,396
    Thank Post
    301
    Thanked 917 Times in 684 Posts
    Rep Power
    346
    Get-Mailbox * -ResultSize Unlimited | where-object {$_.Database -eq "Staff"} | export-csv c:\tmp\mailbox.csv
    Last edited by pcstru; 15th August 2013 at 12:08 PM.

  3. #3

    Join Date
    Mar 2011
    Location
    Bournemouth
    Posts
    280
    Thank Post
    16
    Thanked 74 Times in 64 Posts
    Rep Power
    22
    The only thing wrong with your query is that the value of Database should be the display name not that path.

    Code:
    Get-Mailbox -Database "MCA Staff" -ResultSize Unlimited |Select-Object DisplayName,ServerName,PrimarySmtpAddress, @{Name=“EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_.PrefixString -ceq “smtp”} | ForEach-Object {$_.SmtpAddress}}} | Export-Csv c:\mailbox_alias.csv
    For example.
    Last edited by ChrisMiles; 15th August 2013 at 12:13 PM.

  4. #4
    Darylrese's Avatar
    Join Date
    Sep 2010
    Posts
    445
    Thank Post
    10
    Thanked 7 Times in 6 Posts
    Rep Power
    10
    Quote Originally Posted by ChrisMiles View Post
    The only thing wrong with your query is that the value of Database should be the display name not that path.

    Code:
    Get-Mailbox -Database "MCA Staff" -ResultSize Unlimited |Select-Object DisplayName,ServerName,PrimarySmtpAddress, @{Name=“EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_.PrefixString -ceq “smtp”} | ForEach-Object {$_.SmtpAddress}}} | Export-Csv c:\mailbox_alias.csv
    For example.
    This worked perfectly, thank-you! I'm sure I tried this before but obviously I didn't!



SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 15
    Last Post: 20th January 2011, 10:19 PM
  2. Replies: 4
    Last Post: 9th November 2010, 11:03 PM
  3. Creating Home Folder.. and getting it to map for users
    By dgrams in forum How do you do....it?
    Replies: 16
    Last Post: 26th February 2010, 06:15 PM
  4. Email name change for user in exchange
    By Uraken in forum Windows
    Replies: 4
    Last Post: 18th May 2007, 11:17 AM
  5. I 'm ging to pay for this in the morning
    By ITWombat in forum General Chat
    Replies: 4
    Last Post: 16th June 2006, 10:30 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
  •