Created
March 31, 2016 20:56
-
-
Save micmaher/e105f8fa29e05f17a15e355514ed99ea to your computer and use it in GitHub Desktop.
Gets mailboxes that have forwarders in place, the contact they use, the contacts address and if Store and Forward is on
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
# Gets mailboxes that have forwarders in place, the contact they use, the contacts address and if Store and Forward is on | |
$fwds = get-mailbox -ResultSize Unlimited | Where-Object { $_.ForwardingAddress -ne $null } | select Name, Alias, ForwardingAddress | |
foreach ($fwd in $fwds) { | |
$fwd | add-member -membertype noteproperty -name "ContactAddress" -value (get-contact $fwd.ForwardingAddress).WindowsEmailAddress | |
} | |
Write-Output $fwds | Format-Table -Autosize | Out-String -Width 10000 | Out-File -FilePath c:\temp\output.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment