Use the Exchange Shell to set Out-of-Office status and message

I often have to do user migrations for customers. This includes configuring Out-of-Office messages and settings. I prefer to do this on the Exchange Management Shell, so I don’t have to log in to the users Outlook and set it manually.

Make sure the global Exchange Setting is set correctly under Organization Configuration -> Hub Transport -> Remote Domains

Go to the Properties of your Remote Domain and make sure “Allow external out-of-office messages only” is checked in the General Tab. On the Message Format Tab, verifiy that “Allow automatic replies” and “Allow automatic foward” are enabled.

Also note that the Out-of-Office message is only sent once per recipient.

My preferred approach to achieve this is described here:

Create two txt files somewhere on the Exchange Server, one for the internal message and one for the external message. If you use the same text for both, internal and external recipients you can stick with one file.

In the Exchange Management Shell use the following commands to enable Out-of-Office immediately:

$internalmessage = Get-Content C:\usera_internal.txt
$externalmessage = Get-Content C:\usera_external.txt

Set-MailboxAutoReplyConfiguration -Identity usera@domain.tld -AutoReplyState Enabled -ExternalAudience All -InternalMessage “$internalmessage” -ExternalMessage “$externalmessage”

If you want to enable Out-of-Office at a certain time, use the Scheduled Parameter along with the StartTime and EndTime options

Set-MailboxAutoReplyConfiguration -Identity usera@domain.tld -AutoReplyState Scheduled -StartTime “4/24/2013 08:00” -EndTime “4/30/2013 23:59” -ExternalAudience All -InternalMessage “$internalmessage” -ExternalMessage “$externalmessage”

You can verify the current settings using the Get-MailboxAutoReplyConfiguration cmd

Get-MailboxAutoReplyConfiguration -Identity usera@domain.tld

Leave a Reply

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