Feb 15 2022 06:31 AM - edited Feb 15 2022 06:34 AM
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!
Feb 15 2022 08:26 AM
SolutionFeb 15 2022 11:54 PM
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
Feb 15 2022 08:26 AM
Solution