Dashboard Packs
Microsoft Teams Dashboard
The IT department at Purdue College of Science urgently needed a dashboard to visualize key Microsoft Teams usage metrics for their online classrooms. This dashboard keeps track of the total number of Teams and which are empty, which allows them to pinpoint issues with the data load to create the teams or update issues. The dashboard also monitors for empty class sections to help identify issues with the class selection process.
Challenge
Microsoft Teams classrooms are created for each Division and Section of specific courses at the university, as defined by the Office of the Registrar. Given the large number of sections, and because the creation of Microsoft Teams accounts is problematic, the College of Science wanted to monitor for additions, deletions, changes, etc. of the Teams classrooms.
Specifically, the biggest problem they were facing was trying to identify unused Teams classrooms and watch for their inadvertent deletions.
Solution
The team chose to build a Microsoft Teams dashboard with SquaredUp. Using the Microsoft Teams module for PowerShell, Danny was able to optimise and stack his commands and run the scripts on schedule on a Windows server. Through the use of the native PowerShell tile in SquaredUp, Danny was able to read the results of the scheduled scripts and visualize key metrics on a SquaredUp dashboard, using simple scalar and grid visualisations.
Dashboard walk-through
The top left most column of the Microsoft Teams dashboard shows the total number of Teams they are monitoring, and then splits into two columns.
The left column shows the number of unowned Teams and which Teams are empty, while the right column shows the same for the sections that are unowned or empty.
These are important to ensure that the correct classes have been specified and to ensure that the teams are properly populated. Those that aren't properly populated can be quickly identified and removed or appropriately handled.
How do I import and configure this dashboard?
Ensure you're using SquaredUp DS v5.4 or above.
Already a SquaredUp customer?
Get the latest version of SquaredUp DS for SCOM
New to SquaredUp?
- Download and install the public PowerShell module MicrosoftTeams ExchangeOnlineManagement. You can download it here.
- Install a PowerShell module for the database interaction with your DBMS of choice.
- Create the database with the following PowerShell script. The database defines the table definitions for MY SQL for the current semester . The current semester is used in the PowerShell profiles which enable you to dynamically switch between the current semester (defined in the database) and the previous semester (dynamically created based on whatever current semester is defined in the database).
Note: For the table, you only need the TeamGroupID part for this dashboard. The other parts of the table are for functions the dashboard creator needed outside of this dashboard.
Note: You'll need to replace the database callsInvoke-CoSBD
with calls that work with whatever PowerShell database module or scripts you're using.$ConnectionString = <yourConnectionString> $CreateTeamsTable = @" CREATE TABLE [dbo].[TeamsTable]( [ID] [int] NOT NULL, [GroupID] [varchar](355) NOT NULL, [Semester] [nchar](10) NOT NULL, [subject] [nchar](10) NOT NULL, [number] [nchar](10) NOT NULL, [section] [nchar](10) NOT NULL, [teamgroupid] [varchar](355) NOT NULL, [teamDisplayName] [varchar](355) NOT NULL, [Type] [varchar](10) NOT NULL, CONSTRAINT PK_TeamsTable_ID PRIMARY KEY (ID) ) ON [PRIMARY] "@ $CreateCurrentSemester = @" CREATE TABLE [dbo].[CurrentSemester]( [ID] [int] NOT NULL ) ON [PRIMARY] "@ $CreateSemseter = @" CREATE TABLE [dbo].[Semester]( [ID] [int] NOT NULL, [SemesterCode] [int] NOT NULL ) ON [PRIMARY] "@ Invoke-CoSDBMSSQLNonSelectQuery -ConnectionString $connectionString -Query $CreateTeamsTable Invoke-CoSDBMSSQLNonSelectQuery -ConnectionString $connectionString -Query $CreateCurrentSemester Invoke-CoSDBMSSQLNonSelectQuery -ConnectionString $connectionString -Query $CreateSemester
$ConnectionString = <yourConnectionString> $CreateTeamsTable = @" CREATE TABLE [dbo].[TeamsTable]( [ID] [int] NOT NULL, [GroupID] [varchar](355) NOT NULL, [Semester] [nchar](10) NOT NULL, [subject] [nchar](10) NOT NULL, [number] [nchar](10) NOT NULL, [section] [nchar](10) NOT NULL, [teamgroupid] [varchar](355) NOT NULL, [teamDisplayName] [varchar](355) NOT NULL, [Type] [varchar](10) NOT NULL, CONSTRAINT PK_TeamsTable_ID PRIMARY KEY (ID) ) ON [PRIMARY] "@ $CreateCurrentSemester = @" CREATE TABLE [dbo].[CurrentSemester]( [ID] [int] NOT NULL ) ON [PRIMARY] "@ $CreateSemseter = @" CREATE TABLE [dbo].[Semester]( [ID] [int] NOT NULL, [SemesterCode] [int] NOT NULL ) ON [PRIMARY] "@ Invoke-CoSDBMSSQLNonSelectQuery -ConnectionString $connectionString -Query $CreateTeamsTable Invoke-CoSDBMSSQLNonSelectQuery -ConnectionString $connectionString -Query $CreateCurrentSemester Invoke-CoSDBMSSQLNonSelectQuery -ConnectionString $connectionString -Query $CreateSemester
- Populate the database with your data.
- Create two PowerShell profiles with the following settings:
Note: The reason why you create two profiles is to be able to dynamically switch between semesters. By default, the tiles use the Current Semester profile. The second profile Previous Semester enables you to switch to the previous semester just by selecting this profile in the tile. You could also create a second dashboard for the previous semester with identical tiles and set them to use the previous semester profile.Profile 1:- From the top right hand menu ☰ click system.
- Go to the PowerShell tab.
- Click add new profile.
- Enter a name and a description for the new profile.
- Enter the profile script.
- Click add profile.
The profile is now saved and can be used in a PowerShell tile.
For more help creating a PowerShell profile see How to use the PowerShell tile
Profile 2:#database Connection $connectionString = "Server=itassqlprod01.boilerad.purdue.edu;database=CosReporting;Trusted_connection=True;" #Create the credential needed $cert = get-childitem -path cert:\localmachine\my | where {$_.subject -like "*cn=purdue*"} $cypherText = '<EncryptedPassword>' $un = "<Username>" $credential = new-object -typename System.Management.Automation.PSCredential -ArgumentList $un, $<decrpytedPassword>) #Get the semester code based on the active semester table $QueryCurrentSemester = "SELECT semestercode FROM ClassTeamsSemester JOIN ClassTeamsCurrentSemester on ClassTeamsSemester.ID = ClassTeamsCurrentSemester.ID" $SemesterCode = (Invoke-CoSDBMSSQLSelectQuery -ConnectionString $connectionString -Query $QueryCurrentSemester).tables[0].rows[0].semestercode
#database Connection $connectionString = "Server=itassqlprod01.boilerad.purdue.edu;database=CosReporting;Trusted_connection=True;" #Create the credential needed $cert = get-childitem -path cert:\localmachine\my | where {$_.subject -like "*cn=purdue*"} $cypherText = '<EncryptedPassword>' $un = "<Username>" $credential = new-object -typename System.Management.Automation.PSCredential -ArgumentList $un, $<decrpytedPassword>) #Get the semester code based on the active semester table $QueryCurrentSemester = "SELECT semestercode FROM ClassTeamsSemester JOIN ClassTeamsCurrentSemester on ClassTeamsSemester.ID = ClassTeamsCurrentSemester.ID" $SemesterCode = (Invoke-CoSDBMSSQLSelectQuery -ConnectionString $connectionString -Query $QueryCurrentSemester).tables[0].rows[0].semestercode
#database Connection $connectionString = "Server=itassqlprod01.boilerad.purdue.edu;database=CosReporting;Trusted_connection=True;" #Create the credential needed $cert = get-childitem -path cert:\localmachine\my | where {$_.subject -like "*cn=purdue*"} $cypherText = '<EncryptedPassword>' $un = "<Username>" $credential = new-object -typename System.Management.Automation.PSCredential -ArgumentList $un, $(<DecryptedPassword>) #Get the semester code based on the active semester table $QueryCurrentSemester = "SELECT ClassTeamsSemester.ID FROM ClassTeamsSemester JOIN ClassTeamsCurrentSemester on ClassTeamsSemester.ID = ClassTeamsCurrentSemester.ID" $CurrentSemesterCode = (Invoke-CoSDBMSSQLSelectQuery -ConnectionString $connectionString -Query $QueryCurrentSemester).tables[0].rows[0] $PreviousSemesterID = $($CurrentSemesterCode.ID) - 1 $QueryPreviousSemester = "SELECT semestercode FROM ClassTeamsSemester WHERE ID = '$PreviousSemesterID'" $SemesterCode = (Invoke-CosDBMSSQLSelectQuery -ConnectionString $connectionString -Query $QueryPreviousSemester).tables[0].rows[0].SemesterCode
#database Connection $connectionString = "Server=itassqlprod01.boilerad.purdue.edu;database=CosReporting;Trusted_connection=True;" #Create the credential needed $cert = get-childitem -path cert:\localmachine\my | where {$_.subject -like "*cn=purdue*"} $cypherText = '<EncryptedPassword>' $un = "<Username>" $credential = new-object -typename System.Management.Automation.PSCredential -ArgumentList $un, $(<DecryptedPassword>) #Get the semester code based on the active semester table $QueryCurrentSemester = "SELECT ClassTeamsSemester.ID FROM ClassTeamsSemester JOIN ClassTeamsCurrentSemester on ClassTeamsSemester.ID = ClassTeamsCurrentSemester.ID" $CurrentSemesterCode = (Invoke-CoSDBMSSQLSelectQuery -ConnectionString $connectionString -Query $QueryCurrentSemester).tables[0].rows[0] $PreviousSemesterID = $($CurrentSemesterCode.ID) - 1 $QueryPreviousSemester = "SELECT semestercode FROM ClassTeamsSemester WHERE ID = '$PreviousSemesterID'" $SemesterCode = (Invoke-CosDBMSSQLSelectQuery -ConnectionString $connectionString -Query $QueryPreviousSemester).tables[0].rows[0].SemesterCode
Download and import this dashboard pack.
- Download the dashboard pack zip file for the dashboard pack you wish to import.
There may be additional steps before or after the import to get the dashboard working in your environment.
- In DS for SCOM go to the top right hand menu ☰ > Import Dashboard Packs and drag the zip file into the Manual Import box.
- The dashboard pack is imported and if the pack contains top-level dashboards, these will automatically appear in the navigation bar, usually in a folder called 'Community Dashboards' for dashboard packs from the SquaredUp Community. If the dashboard pack also contains perspectives (see Working with perspectives), then you'll see these when you drilldown to the relevant object.
- Carry out any additional steps required to make the dashboard work in your environment. These steps will be described on the download page for each dashboard. For example, you may need to create the correctly named Web API provider, create a PowerShell profile, or edit tile collections.
- Edit the imported dashboard as required.
- Download the dashboard pack zip file for the dashboard pack you wish to import.
- Add an interval and a timeout to your PowerShell tiles.
- Edit the tile by clicking the Edit button.
- Open the environment panel.
- Enter an interval and a timeout fit to your environment.
Note: The MicrosoftTeams and ExchangeOnlineManagement modules do not process large numbers of teams quickly. Searching for deleted teams out of 200 teams can take 6-7 minutes. For those scripts, you either need to increase the timeout length or run them outside of SquaredUp DS.You can control when the script will run into a timeout. By default, scripts will be aborted after 1 min. You can define a longer timeout for long running scripts.
Best practice:
Even if you can use long running scripts by setting the timeout to several minutes, you shouldn't use scripts that run for a long time. Long running scripts lead to tiles that show a loading spinner for minutes and are not user-friendly.
Tip:
Instead of setting the timeout for scripts to a longer time, run the script outside of SquaredUp DS periodically, and store the results in a CSV file. Create a PowerShell tile that accesses and visualizes the results in the CSV file.
The interval enables you to limit how often a script gets executed in SquaredUp DS. For example, you might want to run a script less frequently if it makes a request to an API that charges you per request or an API that puts a limit on how many requests you can make within a time period.
How does the interval affect how often PowerShell scripts are run in SquaredUp DS?
By default, a PowerShell script will be executed every time the dashboard refreshes (every minute). If you set the interval to 10 mins, you create a 10 min cache for your script results and your script won't run until the last fetched results are 10 mins old.
The interval is not a schedule, it does not trigger a script execution every 10 mins. Scripts will only be executed when the dashboard is reloaded and the results in the cache are older than the interval (10 mins in this example). The cache is valid for all users, which means if another user opens the same dashboard in SquaredUp DS or via Open Access and the script has been executed 5 mins ago, they see the cached results immediately but have to wait for 5 mins to see fresh results.
Can multiple tiles share the same cache?
Identical tiles share the same cache. For tiles to be considered identical, the JSON code of both tiles needs to be identical. If you want to use identical tiles to reduce the load on the back-end, you can copy the JSON from one tile and paste it into a different tile.
The shared cache works across your whole SquaredUp DS instance on:- All dashboards (including Open Access dashboards), as long as they use the same page timeframe
- Perspectives for the same object on the same drill-down using the same page timeframe
Publish the dashboard.
A newly created dashboard will not be visible to others until it is published.
Only admins can publish dashboards, unless you have been given author permissions to a Team Folder see Team Folders
If you made changes to an existing dashboard, the changes will only be visible to others after you published the dashboard again.
You can identify a dashboard that has not been published yet or has unpublished changes by the unpublished button at the top:
When you click on the unpublished button, you'll have two options:
- Publish will make the dashboard or changes visible to others.
Note: A newly created dashboard will appear on the menu where you created it. To move the dashboard to a different place on the navigation bar see How to edit the Navigation Bar. - Discard will delete your draft dashboard if it has never been published or, if you made changes to an already published dashboard, discard the changes.
Publishing dashboards to different audiences
Find out how to publish dashboards to a subset of users using Team Folders or visible to anyone even unlicensed users with Open Access (Sharing Dashboards with anyone - Open Access).
- Publish will make the dashboard or changes visible to others.
GET STARTED TODAY
Zero to dashboard hero in 60 seconds
Start now with hundreds of customizable dashboards.