Set an out of office message using PowerShell
Today I received a call from a colleague who had forgotten to configure their out of office before going on holiday, asking if I could set it for them. Exchange 2010 allows me to do this easily using the Set-MailboxAutoReplyConfiguration PowerShell command:
Set-MailboxAutoReplyConfiguration <alias> -AutoReplyState Enabled -ExternalAudience All -InternalMessage <Message> -ExternalMessage <message>
Here is an example:
Set-MailboxAutoReplyConfiguration Dave.Webb -AutoReplyState Enabled -ExternalAudience All -InternalMessage “I am away on annual leave, please contact the helpdesk if your request is urgent” -ExternalMEssage “I am away on annual leave, so please contact the helpdesk if your request is urgent”
The Set-MailboxAutoReplyConfiguration command supports the following parameters:
- Alias – the alias of the mailbox
- AutoReplyState – enable or disable the auto reply
- InternalMessage – the message to display to users in the same Exchange organisastion
- ExternalMessage – the message to display to users outside of the Exchange organisation
- StartTime – messages will not be sent until this date and time
- EndTime – messages will stop being sent at this date and time
Note: When using the StartTime and EndTime options then the AutoReplyState needs to be set to ‘Scheduled’