Mailbox auto-reply settings are usually created and defined by the users himself. If you want to get an overview of the auto-reply settings of your organization you have to ask every user: “Do you have auto-reply enabled?” Finally you document the answer of the question in your network documentation. No, not really. You will open PowerShell and hit the keys to get an overview of all auto replys of all users in your organization. How to achieve this? Read on …
To get an overview of all auto-reply settings we need to use PowerShell.
Connect to Microsoft 365 Exchange Online
First, open PowerShell, PowerShell ISE or Visual Studio Code and connect to your Microsoft 365 tenant.
$Session = New-PSSession -ConfigurationName Microsoft.Exchange ` -ConnectionUri https://outlook.office365.com/powershell-liveid/ ` -Authentication Basic -AllowRedirection -Credential (Get-Credential) Import-PSSession $Session -DisableNameChecking
How do you know this worked? You should see something like the screen below. PowerShell has imported the Microsoft 365 Exchange Online cmdlets.
Show all Auto-Reply Rules of all Users
Next, run the following command to retrieve an overview of all Auto-Reply settings of your Microsoft 365 tenant.
Get-Mailbox -ResultSize Unlimited | Get-MailboxAutoReplyConfiguration | Where-Object {$_.AutoReplyState -EQ 'Enabled' -or $_.AutoreplyState -EQ 'Scheduled'} | Select-Object -Property Identity,AutoreplyState,StartTime,EndTime
This should show the output below. Note that I have only one user in my Microsoft 365 tenant so my sample screen is a short one. Your output might be more comprehensive.
Disable Auto-Reply on specific users
In case you have found a user that should not have auto-reply enabled, run the following code to deactivate auto-reply on that user.
Set-MailboxAutoReplyConfiguration -Identity f.huber ` -AutoReplyState Disabled
Categories: Microsoft 365, PowerShell
6 replies »