get-forwardmailbox.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
function New-MSOLReport
{
  <#
    .SYNOPSIS
    Gets all mailboxes with that forward mail to a different address
    .DESCRIPTION
    This function outputs all mailboxes that forward mail to a different address. You can use this for compliancy checks.
    .EXAMPLE
    Get-ForwardMailbox
  #>

get-mailbox | where-object {$_.ForwardingSMTPAddress -ne $null} | select-object Name, PrimarySMTPAddress, ForwardingSMTPAddress
}