OOF and PowerShell

I was having some issues with setting the Out of Facility (yes, that is what OOF actually means) for a user. I decided to use PowerShell for this just for the fun of using PowerShell. I love the Exchange Management Shell (EMS) and have been pretty much living at the EMS prompt for the last couple of week when I haven’t been using ISE to build scripts.

So I reviewed the get-help just to make sure I didn’t miss anything and fired off the command using my personal account as a test:

Get-Mailbox russ.kaufmann | Set-MailboxAutoReplyConfiguration –AutoReplyState Enabled -ExternalAudience All -InternalMessage “Hello, I will be out of the office until the end of February. Please e-mail my team with any issues that need attention while I am away. Thank You.” -ExternalMessage “Hello, I will be out of the office until the end of February. Please e-mail my team with any issues that need attention while I am away. Thank You.” -EndTime 3/1/2012

I then ran the command to make sure that everything took properly. I ran:

Get-MailboxAutoReplyConfiguration | FL

This is where I became confused. Everything looked great except that the EndTime showed tomorrow’s date (2/1/2012). At this point, I asked myself, “Self, WTF? Did you not type the date in the correct format?”

I ran the command again and again, modifying the time parameter by putting it in quotes and adding the time of the day along with the date, but it just wouldn’t set the EndTime to the 3/1/2012.

The answer to my angst: You have use use “–AutoReply Scheduled” instead of “-AutoReply Enabled” in order to set the EndTime. This worked perfectly

This lesson was brought to you by the letter W .

Advertisements
This entry was posted in Exchange. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s