Pages

Wednesday, December 8, 2010

Setting Exchange Server 2007 / 2010 Auto Attendant’s Business Hours Schedule via PowerShell Cmdlet

I’m not sure if it’s just me but I find the GUI to customize the business hours schedule from within Exchange 2007 and 2010 somewhat cumbersome to work with. This is especially the case when I’m working on projects for clients which are remote and the remote access method provided provides subpar performance because the mouse can be jerky at times.

Exchange 2007:

image

Exchange 2010:

image

Another issue that I have is that there is only 2 options for the Detail View where you can either display the schedule in intervals of 1 hour or 15 minutes.

Exchange 2007:

image image

Exchange 2010:

image image

Yes, the GUI does allow multiple ways of selecting dates and hours but I find it challenging and time consuming to set hours such as 8:30a.m. to 5:00p.m. In this scenario, I would have to select the Detail View to 15 Minutes, pinpoint where the 30 minute mark was, then click and drag through the blocks that does not fit on one screen.

To overcome this annoyance, I set out to find the PowerShell command to set the business hours schedule which lead me to here: http://technet.microsoft.com/en-us/library/bb123488.aspx. This page gives the example:

EXAMPLE 2

This example configures a UM auto attendant named MyUMAutoAttendant that has business hours configured to be 10:45 to 13:15 (Sunday), 09:00 to 17:00 (Monday), and 09:00 to 16:30 (Saturday) and holiday times and their associated greetings configured to be "New Year" on January 2, 2010, and "Building Closed for Construction" from April 24, 2010 through April 28, 2010.

Set-UMAutoAttendant -Identity MyUMAutoAttendant -BusinessHoursSchedule 0.10:45-0.13:15,1.09:00-1.17:00,6.09:00-6.16:30 -HolidaySchedule "New Year,newyrgrt.wav,1/2/2010","Building Closed for Construction,construction.wav,4/24/2010,4/28/2010"

It took me about a minute to figure out the values for the day, hour and minute since the article doesn’t explicitly map them out:

a.b-c

a = the day where:

0 = Sunday, 1 = Monday, 2 = Tuesday, 3 =Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday

b = the start of day hour with the format:

HH:MM in 24 Hour Format (i.e 08:30)

c = the end of day hour with the format:

HH:MM in 24 Hour Format (i.e 17:00)

In the case of the 7 days a week from 8:30a.m. to 5:00p.m. hours I had to set for a client last night, I would have had to use the 15 minute detail view in the GUI and carefully locate the 8:30a.m. mark, then drag mouse to the 5:00p.m. mark which would have required scrolling. Setting it via the cmdlet in PowerShell was much easier:

Set-UMAutoAttendant -Identity MainAA -BusinessHoursSchedule 0.08:30-0.17:00,1.08:30-1.17:00,2.08:30-2.17:00,3.08:30-3.17:00,4.08:30-4.17:00,5.08:30-5.17:00,6.08:30-6.17:00

image

Here’s another cmdlet for 8:30a.m. to 5:00p.m. Mondays to Fridays only:

Set-UMAutoAttendant -Identity MainAA -BusinessHoursSchedule 1.08:30-1.17:00,2.08:30-2.17:00,3.08:30-3.17:00,4.08:30-4.17:00,5.08:30-5.17:00

Note how the only change that was made was just the removal of:

0.08:30-0.17:00 which represents Sunday

…and…

6.08:30-6.17:00 which represents Saturday

No comments: