Saturday, July 19, 2014

Enable Out of Office thru Powershell

Hi Readers,

With the advent of Exchange 2010 we have got the new feature of setting OOO thru powershell.

Setting Up out of office by Exchange shell:

Set-MailboxAutoReplyConfiguration -identity "" –AutoReplyState Scheduled –StartTime "06/30/2014" –EndTime "07/02/2014" –ExternalMessage "Thanks for your mail. I am out-of-office and do not have access to mails. I will return on 02nd July 8 PM CST. If your matter is urgent, please drop you email to" -InternalMessage "Thanks for your mail. I am out-of-office and do not have access to mails. I will return on 02nd July 8 PM CST. If your matter is urgent, please drop you email to"

If User needs external OOO as well: 

-ExternalAudience:All parameter should be used.

Removing Out of office by Exchange Shell:

Set-MailboxAutoReplyConfiguration "" –AutoReplyState Disabled –ExternalMessage $null –InternalMessage $null

You can also utilize Get-MailboxAutoReplyConfiguration -Identity "" to check the OOO that has been setup.


Sukhija Vikas


  1. Hi Sukhija:

    Nice and concise post. mind if I ask you a question?
    I followed your instruction and "get-mailboxautoreplyconfiguration" show the OOO is enabled, but the email is still coming through when I tested it with an external email address.
    Here is my setup
    SBS2011, exchange 2010
    I am using exchange management shell on the same machine that hosted our SBS and exchange.
    I loaded the target email account on outlook 2013 and test it with a personal gmail account

    Eventually, I am trying to do a recurring OOO with task scheduler. so only between 6 PM to 9 AM it will send out message on a daily basis automatically. but I need to get this power shell work first
    Thanks for your time and expertise

  2. To make it working for external recipient addresses, use -ExternalAudience:All parameter

  3. Thanks. I added "-externalaudience: all" to the line but it does not trigger the auto reply still. Is there anything else I am missing?
    Thank you

  4. The only other thing is on exchnage, under Organization --> Hub Transport --> remote domains --> check setting if external OOO is disabled.

  5. Hi, on the remote domain, we have a default and a * on the domain.
    on the general tab of the properties, "allow external out of office messages and legacy out of office messages..." is checked.
    on the message format tab, "allow automatic replies" is not checked and I checked it.
    The message is still coming through without the automatic reply...

    On the send connectors tab, we do have a outbound rule enabled to Google APPS. We used to have Postini for email filtering service and they got bought out by Google APPS, I will give them a call to see if they block the automatic reply...

    Anyway, I really appreciate your help and if you can think of something else that might help, please share with me. Thank you

  6. Hi I just logged in to the email account via OWA and the automatic reply setting does reflect the cmdlets from power shell. So, it might be a outloook web app problem now...

  7. […] […]

  8. Thanks Sukhija Vikas, this PS command helped me a lot...!

  9. Hi Sukhija,

    I am trying to use this command however I want to incorporate some line breaks into the text of the message. The command sets the message fine but does not include the formatting. I'm using `r`n to try and do this. Can you help at all?

  10. follow below article to use HTML

  11. […] I found the code here and here but I keep getting the following error when I execute the code: […]