Exchange

Need to set out of office message for users using PowerShell

By 2nd June 2015 November 9th, 2017 No Comments

You can set out of office messages by using PowerShell in Exchange2010 upwards, 

Set-MailboxAutoReplyConfiguration <alias> -AutoReplyState enabled -ExternalAudience all -InternalMessage <Message to internal senders> -ExternalMessage <Message to external senders>

  • The StartTime and EndTime parameters can be used if the AutoReplyState setting is set to Scheduled.
  • In this cmdlet,
    • <alias> represents the target user’s alias.
    • <Message to internal senders> represents the message that is generated when you receive email messages from internal senders.
    • <Message to external senders> represents the message that is generated when you receive email messages from external senders.

If you want to have an HTML signature instead of a plain text signature, you must use a text file to load the message.

You cannot use HTML characters in Exchange PowerShell directly. Therefore, the HTML characters must be imported through a text file. To do this, follow these steps:

  1. Create an internalmessage.txt document and an externalmessage.txt document that contain the requested messages.Note The placeholders internalmessage and externalmessage represent the names of the text files that contain the out of office messages.
  2. Run the following cmdlets in the Exchange PowerShell window:
    1. $internalmessage = get-content internalmessage.txt
    2. $externalmessage = get-content externalmessage.txt
    3. Set-MailboxAutoReplyConfiguration <alias> -AutoReplyState enabled -ExternalAudience <none/all/known> -InternalMessage “$internalmessage” -ExternalMessage “$externalmessage”

Categories