Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer 1

up vote 1 down vote accepted
+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.

share|improve this answer
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
add comment

Your Answer

 
discard

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.