Friday, September 17, 2010

Configuring Out of Office settings for other users with Exchange 2010 SP1

Exchange 2010 Service Pack 1 offers two handy new cmdlets, Get-MailboxAutoReplyConfiguration and Set-MailboxAutoReplyConfiguration, that allow you to manage Out of Office (OOF) messages for remote users.  Previously, you used to reset the user's password and logon to the user's mailbox or use a tool like MFCMAPI to manage OOF settings for a given user.

To view the MailboxAutoReply configuration of a particular user, use the following command:

Get-MailboxAutoReplyConfiguration jeff
This will provide output similar to the following:
RunspaceId       : 42d921ae-4179-4fa2-b47a-60197a20b1ae
AutoReplyState   : Scheduled
EndTime          : 9/19/2010 11:30:00 PM
ExternalAudience : All
ExternalMessage  : <html xmlns:o="urn:schemas-microsoft- ... </html>
InternalMessage  : <html xmlns:o="urn:schemas-microsoft- ... </html>
StartTime        : 9/17/2010 6:00:00 AM
MailboxOwnerId   : expta.com/Users/Jeff Guillet
Identity         : expta.com/Users/Jeff Guillet
IsValid          : True
Notice that the OOF above has an AutoReplyState of Scheduled, meaning that it the user has scheduled their OOF to turn on and/or turn off at a certain time.  Valid values are Disabled (off), Enabled (on), and Scheduled.

ExternalAudience determines who gets the OOF message and can be either All, Known (users inside the organization), or Unknown (users outside the organization).

The ExternalMessage and InternalMessage properties hold the actual OOF messages in HTML format.  These can be quite long and difficult to read from the cmdlet due to all the HTML formatting.

The following one-liner will display all users in the org whose OOF is not disabled:
Get-Mailbox | Get-MailboxAutoReplyConfiguration | Where {$_.AutoReplyState -ne 'Disabled'} | ft MailboxOwnerId,AutoReplyState,StartTime,EndTime
This command will disable a user's OOF:
Set-MailboxAutoReplyConfiguration jeff -AutoReplyState Disabled
And this command will enable a user's OOF and schedule it to end automatically:

Set-MailboxAutoReplyConfiguration jeff -AutoReplyState Scheduled -EndTime "09/20/2010 06:00"
Note that if you set the AutoReplyState to Enabled, the OOF will not turn off at the scheduled time.  You must set AutoReplyState to Scheduled for that to happen.  This is contrary to what the examples show in Exchange 2010 SP1 Help, Technet, and the cmdlet help, itself.

If you want to change a user's OOF message, you need to export the ExternalMessage or InternalMessage, edit it in your favorite HTML editor, and import the new message back in.  Here's how you do that:
$x = Get-MailboxAutoReplyConfiguration jeff
$x.ExternalMessage | Out-File oof.txt
Edit the HTML in the exported oof.txt file, and then run the following commands to import it:
$oof = Get-Content oof.txt
Set-MailboxAutoReplyConfiguration jeff -ExternalMessage $oof
. . .

If a user has rights to manage another user using the Exchange Control Panel, they can also configure the OOF for that user using ECP inside Outlook Web App (OWA).

From OWA, click All Options to open ECP.  Then manage the other user, like this:


Select the user to manage and click Tell people you're on vacation on the Account menu.  Then configure the OOF message(s) as needed.  Don't forget to save the new configuration.

. . .

In case you're wondering, OOF actually stands for "out of facility".  OOF was a command used in the days of Microsoft’s Xenix mail system. 10:06 AM