-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathList-TeamApps.ps1
More file actions
48 lines (38 loc) · 1.23 KB
/
Copy pathList-TeamApps.ps1
File metadata and controls
48 lines (38 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<#
.SYNOPSIS
Query all installed apps in a team.
.DESCRIPTION
This script lists all installed applications in a MS Team. The data is queried via GraphAPi.
.NOTES
File Name : list-teamapps.ps1
Author : pascal@rimark.de
Requires : PowerShell Version 5.1
.LINK
To provide feedback or for further assistance email:
pascal@rimark.de
.PARAMETER LogMsg
Specify the Bearer Token to authentificate at GraphAPI
String
.PARAMETER groupid
Specify the GroupId
String
.EXAMPLE
List-TeamApps {YourToken} {YourGroupId}
#>
function List-TeamApps() {
param
(
[Parameter(Mandatory=$True)]
[string]$token,
[Parameter(Mandatory=$True)]
[string]$groupid
)
$btoken = $token.replace("`n", "")
$api = @"
https://graph.microsoft.com/v1.0/teams/GROUPID/installedApps?`$expand=teamsAppDefinition
"@
$apicall = $api.Replace("GROUPID",$groupid)
$apps = Invoke-WebRequest -Method GET -Uri $apicall -Headers @{Authorization="Bearer $btoken"} -UseBasicParsing -ContentType "application/json"
$inner = $apps.Content | ConvertFrom-Json
($inner.Value).teamsAppDefinition
}