Output users Outlook rules in Office 365 using PowerShell

The below PowerShell commands will allow you to check which rules users have got setup in their Outlook rules section in Outlook 365.

Load the MSOnline module and connect to Office 365:

Import-Module MSOnline
$UserCredential = Get-Credential
Connect-MsolService -Credential $UserCredential 
$exchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://outlook.office365.com/powershell-liveid/" -Credential $UserCredential -Authentication "Basic" -AllowRedirection
Import-PSSession $exchangeSession -DisableNameChecking 

 

Get a list of rules for a user:

Get-InboxRule -Mailbox jsmith

 

Show the detail for a particular rule:

Get-InboxRule -Mailbox jsmith -Identity "auto-reply rule" | Select -Property * 

Leave a Reply

Your email address will not be published. Required fields are marked *