0

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?

1
+50

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.

  • 1
    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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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