In this post, I’ll demonstrate how to set up out of office (autoreply) for a user using the Exchange Management Shell in Exchange 2016 or Exchange 2013.
Set-MailboxAutoReplyConfiguration
To set up an out of office response for a mailbox, we can use the Set-MailboxAutoReplyConfiguration cmdlet which allows us to set settings such as those below:
- Enable, disable or schedule out of office
- Out of office message for external users
- Out of office message for internal users
- Whether or not to send out of office responses to external users (not enabled by default)
- Start time
- End time
Examples
Set the out of office message for the Administrator mailbox to be sent to internal users only:
Set-MailboxAutoReplyConfiguration -Identity Administrator -AutoReplyState Enabled -InternalMessage “I’m on annual leave till Monday 4th January”
When internal users attempt to send an email to the Administrator using Outlook, they’ll be presented with a Mailtip that shows them the out of office message:
And when they send an email they will receive the out of office message as normal:
Schedule an out of office message for the Administrator mailbox which sends responses only to internal users from 24th December 5pm to 4th January 9am:
Set-MailboxAutoReplyConfiguration -Identity Administrator -AutoReplyState Scheduled -InternalMessage “I’m on annual leave till Monday 4th January” -StartTime “12/24/2015 17:00” -EndTime “01/04/2016 09:00”
Schedule an out of office message for the Administrator mailbox which sends responses to both internal and external users scheduled from 24th December 5pm to 4th January 9am and includes an HTML reply for external users:
Set-MailboxAutoReplyConfiguration -Identity Administrator -AutoReplyState Scheduled -InternalMessage “I’m on annual leave till Monday 4th January” -StartTime “12/24/2015 17:00” -EndTime “01/04/2016 09:00” -ExternalAudience All -ExternalMessage “<p>Hi,</p><p>I’m on annual leave till Monday 4th January. For any urgent matters, please contact Joe Bloggs on joe.bloggs@litwareinc.com.</p><p>Regards.</p><p>Mark</p>”
Because we have formatted the reply using HTML, we can see that it is formatted nicely in the reply to external users:
The user can always change his out of office as normal even if it has been set by an Administrator using PowerShell:
If your HTML skills are not great, there are many websites out there that will convert your text into HTML.
Get-MailboxAutoReplyConfiguration
We can use Get-MailboxAutoReplyConfiguration to confirm our settings:
Get-MailboxAutoReplyConfiguration -Identity Administrator
To disable an out of office reply for a mailbox:
Set-MailboxAutoReplyConfiguration -Identity Administrator -AutoReplyState Disabled
Hopefully this will help out over the Christmas break when users call up having forgot to set their out of office!
Merry Christmas all!