Problem solve Get help with specific problems with your technologies, process and projects.

Centrally managing out-of-office messages in Exchange Server 2010

Is out-of-office message management possible in Exchange 2010? Microsoft doesn’t officially support it, but our expert attempted a couple methods to find out.

A reader asked me recently if it’s possible to centrally control out-of-office settings in Exchange Server 2010....

Essentially, this person wanted the option to display a uniform out-of-office message for all the users in his organization. Unfortunately, Exchange Server does not offer any policy settings that allow you to enforce the use of mandated out-of-office messages. But there are a few workarounds.

Note: Microsoft does not acknowledge the workarounds discussed in this tip. These methods have come from independent research.

Can you manage out-of-office messages in Exchange 2010 using transport rules?
Since you can't configure out-of-office messages through group policy settings, you’re probably thinking that the easiest way to do so would be through transport rules. Even though Exchange Server 2010 does not contain a transport rule that’s solely dedicated to out-of-office messages, you can create a transport rule that responds to out-of-office messages.

By default, Exchange Server 2010 prepends the words Automatic Reply to a message's subject line when the out-of-office assistant responds to an email. Exchange Server 2007 reacts similarly, but uses the phrase Out of Office instead of Automatic Reply. In either case, it is possible to create a transport rule that looks for these phrasesin the message subject line and then take action.

Unfortunately, this isn’t exactly a comprehensive solution for centrally controlling out-of-office messages. Neither Exchange 2007 nor Exchange 2010 offers a transport rule option to replace a message's text with alternate text. All you can do is append a disclaimer to a message.

Exchange 2010 does offer the option to send a rejection message to the sender with an enhanced status code. In my testing, I originally hoped this type of message could be used as an alternative to an out-of-office message, but Outlook ignored all rejection messages I generated with this method. In other words, this method allows you to detect and take actions on out-of-office messages, but you cannot overwrite them.

Can you manage out-of-office messages in Exchange 2010 using PowerShell?
During my testing, I learned that Exchange Management Shell cmdlets are a better option if you’re looking to centrally control your users’ out-of-office messages. Exchange Server 2010 offers two cmdlets that prove helpful for the task.

The first cmdlet is Get-MailboxAutoReplyConfiguration. You can use this cmdlet to view the out-of-office configuration for a specific user or for all users in your Exchange organization. For example, if you wanted to find out which users are currently using automatic replies, use the following command:

Get-Mailbox | Get-MailboxAutoReplyConfiguration

When you look at Figure 1, you see that this command returns a glut of information about each user’s auto-reply settings. While this list is interesting, the cmdlet doesn’t quite help us toward our goal of centralizing automatic replies.

Use PowerShell to examine your users’ out-of-office messages.

Figure 1. Use the Get-MailboxAutoReplyConfiguration cmdlet to examine an Exchange 2010 user’s out-of-office messages.

As you’d imagine, it’s actually easier to generate a list of users who have automatic replies enabled. Fortunately, we can build off the previous command. To generate a list of users who currently have automatic replies enabled, use the following cmdlet:

Get-Mailbox | Get-MailboxAutoReplyConfiguration | Where-Object {$_.AutoReplyState –eq ‘enabled’} | Format-List Identity

When you look at Figure 2, you see that this command tells you exactly which users currently have automatic replies enabled.

User PowerShell to determine which users have auto-replies enabled.

Figure 2. Use PowerShell to determine which Exchange 2010 users have automatic replies enabled.

Now that you know how to find out which users have auto-replies enabled, the next step is to replace the auto-reply message. However, before I show you how, let’s find out how to set a user’s auto-reply message using PowerShell. For our example, let’s set your user’s reply message to “I am out of the office.” To do so, use the following command:

Set-MailboxAutoReplyConfiguration –Identity User2 –AutoReplyState Enabled –InternalMessage “I am out of the office” –ExternalMessage “I am out of the office”

As you can see, the above command enables automatic replies for User 2 and sets both custom internal and external messages. When you look at Figure 3, you see that this command does not actually generate any output of its own. But if you look at the list of users who have automatic replies enabled, you can see that User2 has been added to the list.

Enable automatic replies for users with PowerShell.

Figure 3. You can also enable automatic replies for a user through PowerShell.

Now that you know how to set a custom automatic reply, as well as how to get a list of users who have automatic replies enabled, let’s combine the two commands to apply a uniform out-of-office message. As a side note, you must remove the Identity parameter from the command above so that the command is applied to all users who have automatic replies enabled, rather than the one specific user. Use the following command:

Get-Mailbox | Get-MailboxAutoReplyConfiguration | Where-Object {$_.AutoReplyState –eq ‘enabled’} |

Set-MailboxAutoReplyConfiguration  –AutoReplyState Enabled –InternalMessage “I am out of the office” –ExternalMessage “I am out of the office”

To see this command in action, let’s take a look at each user’s existing internal and external messages using the following command:

Get-Mailbox | Get-MailboxAutoReplyConfiguration | Where-Object {$_.AutoReplyState –eq ‘enabled’} | Format-List Identity, InternalMessage, ExternalMessage

When you look at Figure 4, you can see that User1 originally had an external message that consisted of a large block of HTML code. I executed the command to make all of the out-of-office messages uniform, then looked at everyone’s out-of-office messages again. As you can see at the bottom of Figure 4, everyone now has the custom out-of-office message I created.

Give all your Exchange 2010 users a uniform out-of-office message.

Figure 4. All Exchange 2010 users now have a uniform out-of-office message.

As you can see, the only problem with this approach is that the commands must be executed manually. There is no centralized policy to enforce your custom out-of-office message. All you can do is create a script that automatically runs these commands on a periodic basis.

Brien Posey is an eight-time Microsoft MVP with two decades of IT experience. Before becoming a freelance technical writer, Brien worked as a CIO at a national chain of hospitals and health care facilities. He has also served as a network administrator for some of the nation’s largest insurance companies and for the Department of Defense at Fort Knox.

Dig Deeper on Exchange Server setup and troubleshooting

Join the conversation


Send me notifications when other members comment.

Please create a username to comment.

Thanks Brian for this article. It's actually pretty easy to set out of office messages for other users with this tool from codetwo:

we're now trialing it for 150 employees
Thank you very much for your article.

The Set-MailboxAutoReplyConfiguration cmd-let works but the font of the message is "Times New Roman" instead of "Calibri" which is the default font.

Would you know how to resolve this ?
$internalMessage ="<html><head></head><body><p style='font-family: arial; font-size:10pt'>Ceci est mon texte</p></body></html>"

set-mailboxAutoReplyConfiguration -identity $identity -autoReplyState enabled -internalMessage $internalMessage -externalMessage $internalMessage

And it works.
Thanks for all this, with which I was able to set the OOR for all disabled accounts (I don't want to overwrite currently active ones), including the desired font. And it immediately propagates to Outlook.
Hi all,

Is there any way to set/change the subject of the auto-reply to something else?

We have moved from an old domain to a new one and im using this AutoReplyConfiguration to let the external audience know that the mail boxes have changed, and it works pretty good but it may be quite confusing for some people who gets the auto-reply as it says out of the office in the subject.
So I wanted to change the subject to lets say: Attention, mail box address will change soon.

Thanks in advance!