Anywhere365: How to manage the Business Hours of a UCC’s with REST, JSON and PowerShell part #1
Title
How to manage the Business Hours of multiple UCC’s with REST, JSON and PowerShell, part #1
(Business) Goal
In Anywhere365 you have the concept of Business Hours for individual Unified Contact Centers. Every contact center has a list in SharePoint where these hours are defined. When you have enough permissions you can edit this very easily.
When you are interested in more details about the concept of Business Hours in Anywhere365 Core I can recommend the Business Hours Explained article on Go Live, which includes a training video.
Recently I was asked to update the Business Hours of multiple Unified Contact Centers. Since I didn’t want to open every single list and edit these via the interface I decided to find a way to automate this. In this first part I want to show you the basics of getting the business hours of a single UCC with REST, JSON and PowerShell
Technical Overview
This article describes how to use JSON to manage your Business Hours. This article is based on the Tips and Tricks – SharePoint article on GoLive documentation of Workstreampeople. In addition to the examples I am throwing PowerShell in the mix.
This script uses the Invoke-RestMethod cmdlet, a cmdlet which can be used to send an HTTP or HTTPS request to a RESTful web service. This cmdlet was introduced in Windows PowerShell 3.0. Like in the Go Live article I used on of my favourite tools to design the requests, Fiddler.
But during the first few tries with the Invoke-RestMethod I came accross an error:
Invoke-RestMethod : The ‘accept’header must be modified using the appropriate property or method.
After some research I found the following description of a Invoke-RestMethod Accept header bug in PowerShell on Microsoft Connect.
Currently the script is far from perfect, so I am only sharing this for inspiration and I would definitely first test it on a testing environment!
Prerequisites
To complete this how-to, you must have the following prerequisites must be met:
– Member of Local Administrators group on the Anywhere365 Application server
– Member of Local Administrators group on every server with Lync Server file shares
– Member of the CSAdministrator group in the domain
– Member of the RTCUniversalServerAdmins group in the domain
Steps
1. Adjust the hard coded path values matching your environment
2. Run the Powershell script in Windows PowerShell via the following command .\get_businesshours_ucc.ps1
Additional resources
Invoke-RestMethod Accept header
TechNet – Invoke-RestMethod cmdlet
Workstreampeople – Business Hours Explained
Workstreampeople – Tips and Tricks – SharePoint
Applies to
Anywhere 365, Skype for Business 2016, SharePoint 2013
Change History
28-04-2017 – 1.0