Created
June 14, 2018 13:09
-
-
Save sdaaish/21a0e726069bf3611ad422dbd23dc650 to your computer and use it in GitHub Desktop.
List email forwarding O365
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
$Mailboxes = Get-Mailbox -ResultSize Unlimited | |
ForEach ($Mailbox in $Mailboxes) | |
{ | |
$MailboxWithRule = Get-InboxRule -Mailbox $Mailbox.Alias | | |
where | |
{ | |
($_.RedirectTo -ne $null) -or ($_.ForwardTo -ne $null) -or ($_.ForwardAsAttachmentTo -ne $null) | |
} | |
if ($MailboxWithRule -ne $Null) | |
{ | |
Write-Host "Brevlådan $($Mailbox.PrimarySmtpAddress) har dessa regler:" $MailboxWithRule | | |
fl Name, Identity, RedirectTo, ForwardTo, ForwardAsAttachmentTo | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From https://www.cert.se/2018/06/vag-av-natfiske-mot-e-postkonton-i-office-365