Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When using Powershell to set Out-of-Office in Exchange 2007 (e.g.), do multiple commands containing -StartTime and -EndTime add to some internal list that Exchange maintains or does each successive command replace the previous command?

For example we have a staffer who is only in the office Tuesdays and Fridays. We'd like to set up Exchange to send an Out-of-Office message to all internal senders on those days when he's not in. How is this best done?

share|improve this question
up vote 1 down vote accepted

Here is how I would handle this request. I would have the following Powershell script run everyday at midnight (or whenever you want the Out-Of-Office status to change).

$dayOfWeek = (Get-Date).DayOfWeek
$offDays = "Monday", "Wednesday",  "Friday", "Saturday", "Sunday"

if ($offDays -contains $dayOfWeek){
    Set-EWSOofSettings -Identity jdoe  -InternalReply "I am out of the office internally" -ExternalReply "I am out of the office external"     

This script simply tests to make sure that today's day is not part of the $offDays, and then if not it turns the Out Of Office status on.

You can run this for multiple users if they are off the same day by having multiple lines setting the EWSOofSettings with different identity defined.

share|improve this answer
tl;dr: there is no native functionality in exchange to do a repeating schedule. you will have to automate it with a powershell script or similar. – longneck Aug 29 '12 at 17:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.