This example delivers email to the mailbox of Douglas Kohn and, at the same time, forwards all mail sent to Douglas Kohn to douglaskohn.parents@fineartschool.net.
[ps] Set-Mailbox -Identity "Douglas Kohn" -DeliverToMailboxAndForward $true -ForwardingSMTPAddress "douglaskohn.parents@fineartschool.net" [/ps]
This example forwards all email sent to the mailbox of Ken Sanchez, an employee of Contoso Suites, to one of his coworkers, pilarp@contoso.com.
[ps] Set-Mailbox -Identity "Ken Sanchez" -ForwardingSMTPAddress "pilarp@contoso.com" [/ps]
For detailed syntax and parameter information, see Set-Mailbox.
Note:
-ForwardingsmtpAddress to multiple addresses Shell script
The parameter “ForwardingSmtpAddress” only allow to setup one SMTP address.
To work around this issue, you can setup the mailbox forwarding to a distribution group, you need to add the users you want to forward message to this distribution group.
link:
https://docs.microsoft.com/en-us/exchange/recipients/user-mailboxes/email-forwarding?view=exchserver-2019
on office365 account, go to portal.office.com > outlook > definitions
REMOVE
[ps]
Set-Mailbox “email xpto” -ForwardingAddress $NULL -ForwardingSmtpAddress $NULL
[/ps]
Home