Search
StarWind is a hyperconverged (HCI) vendor with focus on Enterprise ROBO, SMB & Edge

Monitoring Microsoft Teams using PowerShell Universal Dashboard

  • October 29, 2019
  • 12 min read
IT Production Manager. Nicolas is primarily focused on Microsoft technologies, he is a Microsoft MVP in Cloud and Datacenter Management.
IT Production Manager. Nicolas is primarily focused on Microsoft technologies, he is a Microsoft MVP in Cloud and Datacenter Management.


Microsoft Teams

Microsoft Teams is a powerful communication and collaboration tool that is becoming a major player in the market. Microsoft Teams will replace Skype for Business and StaffHub. Microsoft Teams increases productivity by making all your collaboration– conversations, chats, online meetings, shared files, tasks, and calls available in one single app and one single interface.

In this guide, I will describe how to create a PowerShell Dashboard using the PowerShell Universal Dashboard module created by Adam Driscoll (PowerShell MVP), in order to monitor Microsoft Teams Cloud call queues.

Cloud call queues can provide:

  1. A greeting message
  2. Music while people are waiting on hold
  3. Redirecting calls to call agents
  4. Setting different parameters such as queue maximum size, timeout, …

If you work with Microsoft Teams Call Queues, you must be able to monitor for example the size of the queue, or how many agents are logged in the queue, …
In this guide, I will not explain what PowerShell UD is, because Adam Driscoll has written extensive documentation already on the topic.

Installing Universal Dashboard

Before going deeper, we need to install the Universal Dashboard module using the following command:

In this guide, I installed the community edition which contains a subset of features of the Enterprise Edition. However, you can purchase the Premium Edition in order to enable all the features of Community Edition with added charts, authorization and authentication.

To get a complete list of commands from this module.

UniversalDashboard.Community

Getting Call Queues Information

Before creating the Dashboard, we need to retrieve the statistics from the Call Queues. First, we need to install the Skype for Business Online Connector module: https://www.microsoft.com/download/details.aspx?id=39366

The Skype module includes the New-CsOnlineSession cmdlet, which enables you to create a remote Windows PowerShell session that connects to Skype for Business Online. Be careful, if you install the Microsoft Teams PowerShell module, you will not be able to work with Teams Cloud Call Queues. The Teams module allows you to create new Teams, add a user, create a Teams channel, …

Let’s run the following command to check if Queues are available:

In my case, I can confirm that 3 Queues are available:

        • Team1
        • Team2
        • Team3

3 Queues are available

Now, I can add the following code in order to retrieve statistics from the Queue named “Team1”. This code will create 2 files in the “C:\Dashboard” folder:

        1. The first file contains the size of the queue
        2. The second file contains the number of agents in the queue

NBCallRealTime

Now, you can create a Scheduled Task in order to run this script every 30 seconds for example.

Creating the PowerShell Script

We can now create the script to build the dashboard which will display the following information:

        1. The agents logged in the queue named “Team1”
        2. The calls that are waiting in the queue named “Team1”

Create a file called “Dashboard.ps1” and copy/paste the following code:

You don’t need to run this script because we will create a Windows Service in order to run the dashboard.

Securing the Dashboard

You can secure the dashboard by adding a certificate very easily. In this guide, I created a self-signed certificate using the following script:

Self-signed certificate

To enable HTTPS, you just need to add the following line:

Then, simply specify the -Certificate parameter on Start-UDDashboard cmdlet:

For instance:

Publishing the dashboard as a Windows Service

Universal Dashboard can be run as a Windows service. This is accomplished using Publish-UDDashboard cmdlet.

Please note that DashboardFile must be named “dashboard.ps1”. Once the service is created, you should see the following output:

DashboardFile

At this step, the dashboard has been published. We can see the dashboard using the following URL: https://FQDN/Team1

Teams dashboard

Conclusion

Thanks to PowerShell Universal Dashboard, we can easily monitor any product you want to check. In my case, I built a PowerShell Dashboard to monitor Microsoft Teams very easily, without the expensive cost.

Obviously, you can adjust and customize the dashboard to suit your needs. You can also include other components such as:

      • charts
      • counter
      • card
      • Icons
Hey! Found Nicolas’s article helpful? Looking to deploy a new, easy-to-manage, and cost-effective hyperconverged infrastructure?
Alex Bykovskyi
Alex Bykovskyi StarWind Virtual HCI Appliance Product Manager
Well, we can help you with this one! Building a new hyperconverged environment is a breeze with StarWind Virtual HCI Appliance (VHCA). It’s a complete hyperconverged infrastructure solution that combines hypervisor (vSphere, Hyper-V, Proxmox, or our custom version of KVM), software-defined storage (StarWind VSAN), and streamlined management tools. Interested in diving deeper into VHCA’s capabilities and features? Book your StarWind Virtual HCI Appliance demo today!