How to Turn on Out of Office in Office 365
[Update]: This blog post was updated on October 01, 2021.
Out of office messages in Office 365 (let's assume Office 365 = Microsoft 365, to make things easier) are an extremely useful thing. Not everyone knows though that this simple automatic reply is more than just an email. In this article, I'll quickly go over the basics: what out of office message in Office 365 is and how to set it up for your account. For the real treat, I'll show the easiest way to set up an out of office reply for another user (or all users).
- Out of office messages in Office 365
- Out of office notification in Office 365
- Out of office examples
- How to set your out of office status in Office 365
- How to set up an out of office reply for other users
- How to get out of office status for all users
- Challenges/limitations
Out of office messages in Office 365
The whole concept of out of office messages is fairly simple – they are automatic replies, sent back on your behalf when you are away or busy and someone sends you an email. Every time you set up an out of office reply, its content and settings are stored on your mail server. That's why, no matter if Outlook is turned off or on, automatic replies are sent.
What's more, there's a built-in mechanism which prevents infinite loops. Out of office messages are sent to each sender once. Thanks to that, even if both the sender and the recipient have automatic replies active, an infinite reply loop will not happen.
Out of office notification in Office 365
What is an out of office notification? It's an information that you get when you try to reach someone who has out of office status on. You see, Outlook has come a long way since it was created, and Office 365 is much more than simply email. That's why out of office messages go way beyond simple email autoresponders. Once set up and active, they will trigger MailTips in Outlook and Outlook on the web and set up a corresponding status in Teams:
Keep in mind that those notifications are reserved for people within your Office 365 tenant. External recipients will only get traditional automatic responses by email. Anyway, those internal notifications in Office 365 help a lot with productivity. When you know if your recipients are present or not, it's much easier to plan your tasks. That's why most companies insist on setting out of office replies. And they are right!
Out of office examples
One of the problems with out of office replies is that usually people don't think about how to phrase them until five minutes before leaving for vacation. While this time frame is enough to set up an out of office reply, it might not be enough to come up with a perfect text for your autoresponder (and read it a few times to prevent typos).
That's why it's usually best to just use a sample out of office message, fill in the blanks and adjust it, if necessary. Getting creative is commendable, but sometimes it's just better to keep it safe and use a message which has been proofread thoroughly.
How to set your out of office status in Office 365
To set up an out of office message in Outlook, you need to:
- If you use Outlook: go to File > Info > Automatic Replies,
- If you use Outlook on the web: go to Settings > View all Outlook settings > Mail > Automatic replies,
- In Outlook mobile, go to: Menu > Settings > Account > Automatic replies.
- In Teams, go to Profile > Set status message > Schedule out of office. According to this roadmap item, this feature is being rolled out at the moment. Keep in mind that if you set up an out of office message, Teams pulls this message from the server and sets up its out of office status.
While setting up your own automatic replies in Office 365 is no rocket science, there are situations in which an IT department ends up with the task of setting up someone else's out of office message for them. The most common reason is usually the fact that the user simply forgot to do it. Let's look into the available options.
How to set up an Out of office reply for other users
There are a few different ways to set up an out of office message for another user:
- Microsoft 365 admin center – That's the UI-based approach. It works pretty well but has some drawbacks (see limitations at the end of this article).
- Logging in as this user and setting up their out of office message in, for example, Outlook.
- Creating an inbox rule to set up automatic replies – while definitely an option, it has some additional limitations. You can't schedule them. Also, this feature doesn't come together with adding a Teams status and MailTips. What's more, setting up inbox rules with PowerShell causes all client-side rules to be removed. Read more about inbox rules in Office 365.
- Using PowerShell and the Set-MailboxAutoReplyConfiguration cmdlet.
Out of those methods, using the Set-MailboxAutoReplyConfiguration is by far the easiest and quickest, but it's nice to know the other methods to see exactly how much better it is. Since the second method is questionable in terms of security and the third has some additional drawbacks, I'll describe the first and the last method only.
Required Permissions
Permissions required to set up out of office messages in Office 365 for another user (both via Microsoft 365 admin center and via PowerShell) are as follows:
- Mail Recipients
- User Options
By default, both roles are included in the Organization Management role group. The Recipient management together with the Help desk role group will also include all the required permissions.
Set up out of office reply in Microsoft 365 Admin Center
In your Microsoft 365 Admin Center, go to Users > Active users > Pick a user > Mail > Manage automatic replies.
Here, you will be able to set up the automatic replies for the user you have chosen. Mind that this method doesn't allow you to specify the out of office period, so either the user or you will need to turn those automatic replies off, later on.
As you can see in the image above, the setup is quick and easy. But let me show you a method which is even simpler. At least after a bit of preparation.
Set up an out of office reply with PowerShell
Setting up out of office replies in Office 365 is done with the Set-MailboxAutoReplyConfiguration cmdlet. The cmdlet requires you to insert the out of office message (internal, external or both), scheduled out of office duration and, of course, user's identity. Typing in the out of office message each time is counterproductive, prone to error and might take a lot of time. That's why I want to show you how to create a simple script to make the task as quick and easy as possible.
Start by creating your own script. Below, you can see a sample script, which you can use as is or adjust to your needs. Either way, make sure to change the mailto:[email protected] part.
param ($users, $start, $end) $externalmessage = "Hi,<br>Thanks for your email.<br>I am on leave until $End and will not have any access to my email. If your matter is urgent, you can <a href='mailto:[email protected]'>contact our team</a>. Otherwise, I'll come back to you as soon as I get back in the office.<br>Cheers," $internalmessage = "Hi,<br>I'm out of office until $End. If you need anything urgent, contact my supervisor." foreach ($user in $users) {Set-MailboxAutoReplyConfiguration -Identity $user -AutoReplyState Scheduled -StartTime $start -EndTime $end -ExternalMessage $externalmessage -InternalMessage $internalmessage}
Now, when you save this script, you can manage out of office messages in a matter of seconds. Let's assume I've saved the script to my default PowerShell starting point: C:\users\admin\set-ooo.ps1.
Before you use the script, you need to connect to Exchange Online with PowerShell. After that, all you need to do is call the script with the right parameters. For example:
I want to set up an out of office reply for John Doe starting from November 1, 2020 to November 13, 2020:
.\set-ooo.ps1 -users j.doe -start 11/01/2020 -end 11/13/2020
And that's it, both internal and external out of office messages will be set up, according to the text from the script above.
But what if I want to set up out of office for today and tomorrow for everyone, because there is a national holiday coming up?
.\set-ooo.ps1 -users (get-mailbox).UserPrincipalName -start (get-date) -end (((get-date).adddays(1)).ToShortDateString())
And if all members of Marketing department have suddenly gone missing an hour ago and I know they will be back after 4 hours:
.\set-ooo.ps1 -users (Get-UnifiedGroupLinks -Identity "Marketing" -LinkType Members).UserPrincipalName -start (get-date).addhours(-1) -end (get-date).addhours(4)
Advanced options
The script shown above is basic, just to show you the idea and how to use the tools that you have. There are quite a few useful parameters you can add to the Set-MailboxAutoReplyConfiguration cmdlet in Office 365:
- -AutoDeclineFutureRequestsWhenOOF $true will cause all meeting requests to be declined while the out of office status is active.
- -DeclineAllEventsForScheduledOOF $true can be used to decline all accepted events which take place during the out of office period.
- -DeclineMeetingMessage specifies the message text sent to meeting organizers if at least one of the two previous parameters are used.
- -CreateOOFEvent $true creates an event for the time the out of office status is active. It will make it easier for meeting organizers to use the scheduling assistant.
- -OOFEventSubject specifies the subject of the out of office event.
In case you were wondering about the OOF part – it's an abbreviation of the old-school "Out of facility" term. What's interesting you can come across the OOF phrase fairly often, even though I don't think I have ever heard anyone saying "Out of facility" out loud.
Now, setting up the out of office status company-wide is one thing, finding out what's the OOF status of all users is another. While you could go through the Active users tab in the Microsoft 365 admin center and check the status for each user individually, using PowerShell is much more efficient.
How to get the out of office status with PowerShell
There are many reasons while you might want to check the out of office status in your Microsoft 365 organization, for example:
- to confirm whether the above script succeeded,
- to get the general idea about how many users have their OOF active (as opposed to how many are actually out of office),
- to see which users followthe company's standards regarding out of office messages.
Fortunately, you can easily check the OOF status of all users with an easy PowerShell script. To be honest, calling those sets of cmdlets "a script" is an overstatement, too. Which is perfect, as it is incredibly easy to use, understand and modify to your needs. See the comments in the code to learn what each part of the script does.
$autoreplies = (get-mailbox | Get-MailboxAutoReplyConfiguration) <# Gets the out of office status of all mailboxes and saves it in the $autoreplies variable. You need to run this line any time you need to get fresh data from the server. #> $autoreplies | group-object -property autoreplystate | sort-object count -Descending | select name, count <#The most general part. It shows how many users have their out of office status set to Enabled, Disabled and Scheduled. #> foreach ($autoreply in $autoreplies) {if ($autoreply.AutoReplyState -eq "enabled") { $autoreply.identity, $autoreply.AutoreplyState -join ' - '} if ($autoreply.AutoReplyState -eq "scheduled"){$autoreply.Identity, $autoreply.AutoReplyState,$autoreply.StartTime , $autoreply.EndTime -join " - "}} <# This part of the script returns a list of all users who have their autoreplies set to enabled or scheduled. If it's the latter, it also returns the start and end date. #> foreach ($autoreply in $autoreplies) { if ($autoreply.ExternalMessage) {$autoreply.identity , $autoreply.ExternalMessage}} <# This part returns all users who have their external OOF message configured and displays this message. You can add, e.g., the export-csv cmdlet if you need to forward this to someone. #>
Challenges/limitations
While out of office messages are important for productivity reasons, keep in mind that there are some challenges involved:
- Standard out of office messages, sent on a server-level, are limited in terms of formatting. You can add hyperlinks, write in bold etc. but adding e.g. your professional HTML email signature will not be an option.
- Autoresponders set via inbox rules may include images (like a logo or banner) but will not trigger MailTips or a status change in Teams. Also, there is no way to schedule those autoresponders, which means that you'll need to remember to turn them off.
- If you set up an out of office message in Microsoft 365 admin center, there is no way to schedule the out of office period.
Read also
- How to add user photos to Microsoft 365 without PowerShell
- Message tracking in Microsoft 365 (Exchange Online)
- Email signature management in Exchange Online
How to Turn on Out of Office in Office 365
Source: https://www.codetwo.com/admins-blog/out-of-office-messages-office-365/