SOLVED

Forward rule for all users

Copper Contributor

Hi everyone,

 

Looking for a clever way to set up a forward rule (all incoming traffic) for all our users from one tenant to another due to a recent acquisition. Was wondering if anyone knows of a powershell script or something similar to accomplish this? Thanks!

2 Replies
best response confirmed by TH_ (Copper Contributor)
Solution
Most third-party t2t migration tools have some way to redirect mail flow, that should be your go-to option. Other than that, PowerShell is your friend - simple loop over all mailboxes, and set the forwarding address to the corresponding @newtenant.onmicrosoft.com address.

@Vasil Michev 

 

I simply created a csv with UPN and the ForwardToAddr and imported that in the script below. Seems to have done the trick.

 

$users = import-csv '.\UserMailboxes.csv'
foreach ($user in $users)
{
    Set-Mailbox $user.UPN -ForwardingSmtpAddress $User.FWD -force
 
    Write-Host "$($user.UPN) now forwards to ($user.FWD)"
}
$users = $null

 

1 best response

Accepted Solutions
best response confirmed by TH_ (Copper Contributor)
Solution
Most third-party t2t migration tools have some way to redirect mail flow, that should be your go-to option. Other than that, PowerShell is your friend - simple loop over all mailboxes, and set the forwarding address to the corresponding @newtenant.onmicrosoft.com address.

View solution in original post