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?
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).
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.