How to Set Automatic Out of Office Reply Using PowerShell

How to Set Automatic Out of Office Reply Using PowerShell

Out of Office (OOF) automatic reply messages helps to notify other users who are trying to reach you in Outlook when you are unavailable. For example, say you are on vacation, you can set up an automatic reply in Office 365. This way, other users will know you are unavailable for a while.

Configuring automatic replies is essential to prevent communication lapses between OOF users and their clients. What if a user missed setting up an Out of Office message in Outlook? They will continue to receive emails, but their colleagues and external partners will not be aware of their absence. To avoid this, admins can set an OOF reply message for any Office 365 user.

Let us look for ways to set automatic replies on a user’s mailbox in Microsoft 365 in this blog.

Different Ways to Configure Automatic Replies in Office 365

When a user fails to set up an automatic reply in Outlook, the Office 365 admins or Exchange admins can set automatic out-of-office replies on a user’s mailbox. Admins can configure auto-replies in four different ways. They are,

1 . Automatic Replies in Office 365 admin center:

    • Open Office 365 Admin center –> Users –> Active users. Choose any user, and then click the Mail tab in the flyout.
    • In the Mail tab, we need to select Manage automatic replies and turn them on.

(You can write separate customized messages for internal and external recipients as you wish)

2. Set auto-reply in the Exchange admin center:

    • Open Exchange admin center.
    • Then Recipients –> Mailboxes. Choose any user, and then click the Others tab in the flyout.
    • In the Others tab, select Manage automatic replies and turn them on.

To schedule out-of-office messages with a specific time and date, follow the instructions below.

In the EAC, click the user icon on the right and choose Open another mailbox –> Organize email –> automatic replies. Specify the date and time to schedule the automatic reply messages.

schedule automatic out-of-office replies

3. Set Out-of-Office automatic replies with inbox rules:

Using inbox rules, you can send out-of-office messages to incoming emails when you are away.

4. Configure automatic replies in Office 365 using PowerShell:

Lastly, setting up automatic out-of-office replies in Outlook using PowerShell is the easiest method of doing so.

Let’s discuss how to configure automatic replies using PowerShell in more detail.

What Makes PowerShell Feasible to Set Automatic Reply Messages?

Manually setting an auto-reply message for multiple users is time-consuming. With PowerShell, you can easily configure auto-reply messages for a single user and multiple users by importing a CSV file.

You can use Set-MailboxAutoReplyConfiguration PowerShell cmdlet to set automatic replies in Outlook. It is available on both On-premises and Exchange Online.

Make sure to Connect with Exchange Online PowerShell before you begin to work with the cmdlets.

Various Use Cases of Out-of-Office Settings Using PowerShell:

Set Outlook Automatic Reply for Another User:

Auto-replies aren’t necessary for Office 365 mailboxes, but having them can prevent a lack of communication in the Office 365 workspace. If a user forgot to configure out-of-office messages in Outlook, admins can configure them using the below cmdlet.

Set-MailboxAutoReplyConfiguration –Identity [email protected] -AutoReplyState Scheduled –InternalMessage “I’m out of the station, will reply to your messages once I’m available.” -ExternalMessage “Please contact me later, currently, I’m unavailable”

Internal Messages – Refers to the message to be sent to colleagues.
External Messages – Refers to the message to be sent to the external recipients.

Once you’ve configured messages using PowerShell, you can check whether the setting has been applied or not in the admin center. If applied, it’ll appear as shown below.

out-of-office automatic reply messages

Schedule Auto-Reply Message with Start and End Time:

Suppose you wish to send an automatic reply message only for a specific time, you can imply the parameters –StartTime and –EndTime in the cmdlet.

Set-MailboxAutoReplyConfiguration –Identity [email protected] -AutoReplyState Scheduled –StartTime “8/08/2022 12:00” -EndTime “9/08/2022 12:00” –InternalMessage “I’m sick, will get back to you tomorrow”  

The above cmdlet can be used to create out-of-office messages with specific start and end times. This cmdlet automatically sends the provided reply message to all the internal recipients who have mailed “Frida” between 8th August 12 PM to 9th August 12 PM.

Configure Exchange Automatic Replies for Multiple Users:

Setting up different messages for multiple users seems complicated using the admin center. With PowerShell, it’s a piece of cake. All you need to do is import a CSV file with the required fields.

Required Fields in the CSV file:

Create a CSV file with the user principal name and the messages to be delivered (Either a standard message for all users or a different message for all users).

import file to set automatic out-of-office reply message

PowerShell cmdlet to enable automatic replies for bulk users:

Connect-ExchangeOnline
$User = Import-Csv C:\importautoreply.csv 
foreach($user in $user){
Write-Progress -Activity "Adding auto-reply message to -$user..."
Set-MailboxAutoreplyConfiguration -Identity $User.User -AutoReplyState Enabled -Internalmessage $User.InternalMessage
If($?)
{
Write-Host Auto-reply message successfully added to $User.user -ForegroundColor Green
}
Else
{
Write-Host Error occurred while adding auto-reply message to $User.user -ForegroundColor Red
}
}

You shall replace the CSV path based on your input location. And by using the above script, Office 365 admins can set automatic replies for multiple users.

Turn Off Auto-Reply Messages in Office 365:

To turn off the automatic reply messages, make auto-reply state as disabled. Run the below cmdlet to disable the automatic reply configuration for any users.

Set-MailboxAutoReplyConfiguration –Identity [email protected] -AutoReplyState Disabled

Get Mailbox Automatic Reply Configuration Report:

Sometimes the users may turn on or off auto-reply messages as they wish, so it is of utmost necessity to monitor automatic reply configurations across your organization. You can download the script to get the mailbox automatic reply configuration report.

Script Highlights:

  • Generates 5 different types of out-of-office setup status reports.
  • Automatically installs the Exchange Online module upon your confirmation when it is not available on your machine.
  • Lists aggregated results of users with enabled and scheduled auto-reply set up.
  • Retrieves users who have enabled auto-reply settings.
  • Generates users who configured scheduled out of office set up separately.
  • Lists currently unavailable users’ out-of-office configurations.
  • You have an option to get the disabled mailboxes with an active automatic reply setting.
  • Delivers Office 365 users’ upcoming out-of-office plans details.
  • Supports both MFA and Non-MFA accounts.
  • Exports the report in CSV format.
  • The script is scheduler-friendly. You can automate the report generation upon passing credentials as parameters.

Sample Output:

The script has all the significant use cases and easy execution formations. The report has detailed data that will help you to get users out of office settings quickly.

get mailbox automatic reply configuration

Do you wish to easily monitor the Out-of-Office replies without relying on PowerShell? Fear not, because we have an easy-to-go solution to fulfil all your requirements.


Effortlessly Monitor the Automatic Out of Office Reply now in AdminDroid!

AdminDroid Exchange Online Reporting Tool, an ultimate reporting solution to monitor all your Out-of-Office replies in your Microsoft 365 environment. Painlessly analyze the reports on Out-of-Office replies with in-depth details like mailbox count by auto-reply state, by decline meeting message, or by recipient type through AdminDroid. It provides the following reports to make you more aware of your users’ email performance in and around the organization.

Email Message Settings

  • Out-of-Office event settings
  • Active Out-of-Office settings
  • Out-of-Office email settings
  • Email signature settings
  • Message size and delivery restrictions

Out-of-Office event settings in AdminDroid

Moreover, the AdminDroid Exchange Online management tool allows you to have a complete overview of your users’ Outlook usage to analyze and optimize email performance. Not only it gives reports on Exchange Online, but also provides reports on various Microsoft 365 services for advanced administration capabilities. Furthermore, AdminDroid has around 1800+ comprehensive reports furnished with details and displays them in 30+ sleek dashboards. The tool possesses advanced features like scheduling, alerting, granular delegation, etc., with a user-friendly interface. Above all, it is an easy-to-set-up tool that updates automatically without requiring any installations by the user.

To conclude, I hope this blog helped you to understand how to set automatic reply messages using PowerShell and the admin center. If you have any queries, reach us out in the comment section. We would be glad to solve it for you!

How to Set Automatic Out of Office Reply Using PowerShell

by Pavithra time to read: 5 min
0