The problem: when users leave the company, they create server side rules to forward their mail to an outside address. An administrator wanted to know if there was a way to clear rules in Outlook or with a powershell command.
My own preference is to configure Exchange server to not allow automatic forwarding to the Internet, problem solved. However, if you need to allow automatic forwarding to the Internet, there are several other solutions available to you.
Other Solutions
If you can’t disable automatic forwarding to the Internet, create a transport rule that drops messages sent from the terminated addresses. Add the addresses to a distribution group and create a transport rule that looks for mail sent from members of the distribution group. You can drop the messages or redirect them to another address (this will alert you to the presence of a forwarding rule on the mailbox.)
You can remove the rules from Outlook (any version) by starting Outlook with the /cleanrules switch. This requires you to open the user’s profile in Outlook, which can be time consuming if you need to check a lot of mailboxes. It’s not possible to do it using powershell. If you use the transport rule to redirect mail to a monitored address, you can use /cleanrules on those mailboxes that have forwarding rules configured.
The final option is to either disable or delete the mailbox. If you need to continue monitoring the address, add the user’s email address to another mailbox or public folder. Otherwise, allow the mail to bounce with an NDR or deliver it to a dropbox.
If you want to keep the mailbox around for a bit, you can configure it so it can’t send email by setting the maximum message size allowed to 0. You can do this using a cmdlet:
Set-Mailbox -identity "Name" -MaxSendSize "0"
If you need to apply it to many mailboxes, it can be used with a list of names in a csv:
$a= import-csv c:\terminated_users.csv $a | foreach { Set-Mailbox -MaxSendSize "0" $_.name}One of these solutions, or a combination, should solve your problem.


