Managing Outlook rules using PowerShell

To view the rules associated with a mailbox use the Get-InboxRule cmdlet. Very useful when you are troubleshooting a remote user who is not getting emails and you suspect the rules could have a hand in it.

The cmdlet requires the initials of the user whose mailbox you want to check via the -Mailbox switch:

To view a particular rule you can pass its name to the cmdlet:

The good thing about manipulating rules via PowerShell is that you can filter based on the rule properties. Pipe the output to get-member to see the various properties:

Then you can do stuff like:

To disable and enable rules you have the Disable-InboxRule and Enable-InboxRule cmdlets.

Notice how the cmdlet failed for a client only rule? You can find such rules by using the SupportedByTask property:

Lastly, to mass enable or disable rules do thus (in the examples below I am selecting rules matching certain criteria, but that’s optional):

PowerShell can also be used to create and delete rules. Like thus: