The next step from my automatic RGS holiday set was to see if it could be converted to work with Auto Attendant in Skype Online. Easier said than done.
In the Office 365 portal you set opening hours by creating a weekly reoccurring schedule like this:
There is no way in the GUI to set a future date where the phone lines are closed. Tried going through every menu in the Skype Online portal, but no luck. My first thought was, there has to be a way to do it in PowerShell.
I looked up what commandlets that are available for Auto Attendant:
What first caught my attention, was the New-CsOnlineSchedule commandlet.
So the way you create a Schedule is you create a time range like this:
$timerange = New-CsOnlineTimeRange -Start 08:00 -End 16:00
Then you use this time range and set it to a weekly schedule like this:
What this script does is that it goes trough each date in my holidaylist $holidays to check if one of those dates match todays date. If it gets a match, then it redefines one of the day variables, and sets the time range to the value of $vaule. The easiest was to create a range where the phones were open for one minute in the middle of the night to mark this as a day where the phone is closed. If this was set to a daily schedule it should automatically close the phoneline on holidays.
I tested to create a schedule, but it did not update the schedule in the GUI. After spinning my head around a little, it hit me. Off course, new-CsOnlineSchedule only creates a schedule but not sets it. The problem I then encountered was that there was no commandlet called Set-CsOnlineSchedule. I started going through the different commandlets, and found that inside New-CsOrganizationalAutoAttendant there was a parameter called Schedules.
When you create a new Auto Attendant by using New-CsOrganizationalAutoAttendant you can set the schedule to be one created with New-CsOnlineSchedule. But I needed to set a schedule on a already created Auto Attendant, so I tried looking at the Set-CsOrganizationalAutoAttendant. The only parameter in that commandlet was Instance. From the commandlet example, you need to do it like this to change something:
After this I started going deep down the rabbit hole of PowerShell and .net, so I don’t remember how I found out this next thing. I found out that the assembly of the Schedules parameter was named Microsoft.Rtc.Management.Hosted.Online.Models.Schedule.
This was not possible.
Usually when you try to load an assembly, you could do it like this:
Add-Type -Path ‘c:\filer\Microsoft.Rtc.Management.Hosted.Online.Models.Schedule.dll
Tried looking in the PowerShell module folders on the computer, but did not find anything.
My question in the end:
Why haven’t Microsoft added the possibility to update the schedule?