top of page
Writer's pictureKyle Anderson

Find Out What Teams Apps Your Users Are Using

If your organisation has adopted Microsoft Teams, then you may be interested to find out what apps are being used by your users. In this post we are going to look at how you can extract that information from your tenant to allow for the creation of more informed policies.


 

Teams Admin Centre


The Teams admin centre does give you some insight into app usage by providing usage reports for download.


This report will give you details about all the apps that have been used, but not all of the apps installed. An app that is installed, used and uninstalled, will still appear in this report. Equally, if an app is installed and used outside of a 90-day reporting window, then it will not appear on the report. In order to get all the apps installed across Teams, we will need a PowerShell solution.


 

PowerShell


In order to install the packages needed for this solution to work, you will need admin rights on your machine. If you are unsure about your permission to do this then it would be best to contact your IT administrator.


This is the cmdlet we will be using to make our script work.

Get-TeamsAppInstallation

Before we can run our script, make sure you have installed the correct version of the Teams PowerShell module. Microsoft has documentation on this cmdlet, but at the time of writing it is still in preview and can be found in the PowerShell Gallery.


The script is very simple and works by retrieving all of the Teams in your tenant and listing all of the apps installed in the team.


Adjust the script to suit your needs.

<#$login = ""
$pword = ""
$pword = ConvertTo-SecureString $pword -AsPlainText -Force
$credentials = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $login, $pword#>

#Connect to Teams as admin
Connect-MicrosoftTeams #-Credential $credentials

#Get all the Teams that have not been archived.
$Teams = Get-Team -Archived $false

#Output number of Teams
Write-Host $Teams.Count

$CSVPath = "C:\Users\Desktop\TeamsOutput.csv"
$ErrorPath = "C:\Users\Desktop\ErrorsTeamsOutput.csv"
$AppData = @()
$ErrorData = @()

foreach ($Team in $Teams) {
 Try {
 #Get all the apps installed on the Team
 $Apps = Get-TeamsAppInstallation -TeamId $Team.GroupID -ErrorAction Stop

 foreach ($App in $Apps) {
 #Build CSV of all Apps in use
 $DataCollection = New-Object PSObject -Property ([Ordered] @{
 Team                 = $Team.DisplayName
 TeamID               = $Team.GroupID
 TeamType             = $Team.Visibility
 AppDisplayName       = $App.DisplayName
 AppID                = $App.TeamsAppId
 AppVersion           = $App.Version
 ID                   = $App.Id
 TeamsAppDefinitionId = $App.TeamsAppDefinitionId
                })
 $AppData += $DataCollection
        }
    }
 catch {
 #Build error CSV
 $ErrorCollection = New-Object PSObject -Property ([Ordered] @{
 Team        = $Team.DisplayName
 TeamID      = $Team.GroupID
 TeamType    = $Team.Visibility
            })
 $ErrorData += $ErrorCollection
    }
}

#Output list of Apps installed in Teams
if ($AppData.Count -gt 0) {
 $AppData | Export-Csv -Force -NoTypeInformation -Path $CSVPath
 Write-host -f Green "CSV created and exported"
}

#Output list of Teams that errored
if ($ErrorData.Count -gt 0) {
 $ErrorData | Export-Csv -Force -NoTypeInformation -Path $ErrorPath
 Write-host -f Red "Error CSV created and exported"
}

Once the script has finished running, you will have a CSV that can be used for analysis.


 

Expansion and Conclusion


As a Teams admin, it is a very good idea to know what is happening in your tenant. This script will allow you to have a much better understanding of what your users are installing in Teams, allowing you to make better policy decisions going forward.

This script is just the start though, you could take this and adapt it as part of a larger reporting solution. By storing it in an Azure Runbook, scheduling it to run regularly and storing the results, you could gain a long-term understanding of what your users are doing and what they may be interested in, in the future.

880 views0 comments

Recent Posts

See All

Comments


bottom of page