Created
May 30, 2014 16:51
-
-
Save lordmuffin/4504eade6c0fa0b08626 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Get all mailbox email addresses and output to csv | |
$mbx = Get-Mailbox -ResultSize Unlimited | Select DisplayName, EmailAddresses | |
$foreach = Foreach($mailbox in $mbx) { | |
New-Object PSObject -Property @{ | |
DisplayName = $mailbox.DisplayName | |
EmailAddresses = [String]$mailbox.EmailAddresses | |
} | |
} | |
$foreach | Select DisplayName, EmailAddresses | Export-Csv -Path C:\Scripts\mbx-email-addresses.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment