Skip to content

Commit 43c512f

Browse files
Reports Action Pack MS Teams
1 parent b25a5b3 commit 43c512f

13 files changed

+787
-9
lines changed

O365/MS-Teams/Policies/Get-MSTUserPolicyAssignment.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
Param(
4040
[Parameter(Mandatory = $true)]
4141
[pscredential]$MSTCredential,
42+
[Parameter(Mandatory = $true)]
4243
[string]$Identity,
4344
[ValidateSet('CallingLineIdentity', 'OnlineVoiceRoutingPolicy', 'TeamsAppSetupPolicy', 'TeamsAppPermissionPolicy', 'TeamsCallingPolicy', 'TeamsCallParkPolicy', 'TeamsChannelsPolicy', 'TeamsEducationAssignmentsAppPolicy','TeamsEmergencyCallingPolicy', 'TeamsMeetingBroadcastPolicy', 'TeamsEmergencyCallRoutingPolicy', 'TeamsMeetingPolicy', 'TeamsMessagingPolicy', 'TeamsUpdateManagementPolicy', 'TeamsUpgradePolicy', 'TeamsVerticalPackagePolicy', 'TeamsVideoInteropServicePolicy', 'TenantDialPlan')]
4445
[string]$PolicyType,
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#Requires -Version 5.0
2+
#Requires -Modules @{ModuleName = "microsoftteams"; ModuleVersion = "1.1.4"}
3+
4+
<#
5+
.SYNOPSIS
6+
Generates a report with the group policy assignments
7+
8+
.DESCRIPTION
9+
10+
.NOTES
11+
This PowerShell script was developed and optimized for ScriptRunner. The use of the scripts requires ScriptRunner.
12+
The customer or user is authorized to copy the script from the repository and use them in ScriptRunner.
13+
The terms of use for ScriptRunner do not apply to this script. In particular, ScriptRunner Software GmbH assumes no liability for the function,
14+
the use and the consequences of the use of this freely available script.
15+
PowerShell is a product of Microsoft Corporation. ScriptRunner is a product of ScriptRunner Software GmbH.
16+
© ScriptRunner Software GmbH
17+
18+
.COMPONENT
19+
Requires Module microsoftteams 1.1.4 or greater
20+
Requires Library script MSTLibrary.ps1
21+
Requires Library Script ReportLibrary from the Action Pack Reporting\_LIB_
22+
23+
.LINK
24+
https://github.com/scriptrunner/ActionPacks/tree/master/O365/MS-Teams/_REPORTS_
25+
26+
.Parameter MSTCredential
27+
[sr-en] Provides the user ID and password for organizational ID credentials
28+
[sr-de] Enthält den Benutzernamen und das Passwort für die Anmeldung
29+
30+
.Parameter GroupId
31+
[sr-en] Specify the specific GroupId
32+
[sr-de] Gibt die Gruppen-Id an
33+
34+
.Parameter PolicyType
35+
[sr-en] The type of the policy package
36+
[sr-de] Typ des Ploiciy Pakets
37+
38+
.Parameter TenantID
39+
[sr-en] Specifies the ID of a tenant
40+
[sr-de] ID eines Mandanten
41+
#>
42+
43+
[CmdLetBinding()]
44+
Param(
45+
[Parameter(Mandatory = $true)]
46+
[pscredential]$MSTCredential,
47+
[string]$GroupId,
48+
[ValidateSet('TeamsAppSetupPolicy', 'TeamsCallingPolicy', 'TeamsCallParkPolicy', 'TeamsChannelsPolicy', 'TeamsComplianceRecordingPolicy', 'TeamsEducationAssignmentsAppPolicy', 'TeamsMeetingBroadcastPolicy', 'TeamsMeetingPolicy', 'TeamsMessagingPolicy')]
49+
[string]$PolicyType,
50+
[string]$TenantID
51+
)
52+
53+
Import-Module microsoftteams
54+
55+
try{
56+
ConnectMSTeams -MTCredential $MSTCredential -TenantID $TenantID
57+
58+
[hashtable]$getArgs = @{'ErrorAction' = 'Stop'}
59+
60+
if([System.String]::IsNullOrWhiteSpace($PolicyType) -eq $false){
61+
$getArgs.Add('PolicyType',$PolicyType)
62+
}
63+
if([System.String]::IsNullOrWhiteSpace($GroupId) -eq $false){
64+
$getArgs.Add('GroupId', $GroupId)
65+
}
66+
67+
$result = Get-CsGroupPolicyAssignment @getArgs | Select-Object *
68+
69+
ConvertTo-ResultHtml -Result $result
70+
}
71+
catch{
72+
throw
73+
}
74+
finally{
75+
DisconnectMSTeams
76+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#Requires -Version 5.0
2+
#Requires -Modules @{ModuleName = "microsoftteams"; ModuleVersion = "1.0.5"}
3+
4+
<#
5+
.SYNOPSIS
6+
Generates a report with all the policy packages available on a tenant
7+
8+
.DESCRIPTION
9+
10+
.NOTES
11+
This PowerShell script was developed and optimized for ScriptRunner. The use of the scripts requires ScriptRunner.
12+
The customer or user is authorized to copy the script from the repository and use them in ScriptRunner.
13+
The terms of use for ScriptRunner do not apply to this script. In particular, ScriptRunner Software GmbH assumes no liability for the function,
14+
the use and the consequences of the use of this freely available script.
15+
PowerShell is a product of Microsoft Corporation. ScriptRunner is a product of ScriptRunner Software GmbH.
16+
© ScriptRunner Software GmbH
17+
18+
.COMPONENT
19+
Requires Module microsoftteams 1.0.5 or greater
20+
Requires Library script MSTLibrary.ps1
21+
Requires Library Script ReportLibrary from the Action Pack Reporting\_LIB_
22+
23+
.LINK
24+
https://github.com/scriptrunner/ActionPacks/tree/master/O365/MS-Teams/_REPORTS_
25+
26+
.Parameter MSTCredential
27+
[sr-en] Provides the user ID and password for organizational ID credentials
28+
[sr-de] Enthält den Benutzernamen und das Passwort für die Anmeldung
29+
30+
.Parameter Policy
31+
[sr-en] The name of a specific policy package
32+
[sr-de] Name des Policy-Pakets
33+
34+
.Parameter TenantID
35+
[sr-en] Specifies the ID of a tenant
36+
[sr-de] ID eines Mandanten
37+
#>
38+
39+
[CmdLetBinding()]
40+
Param(
41+
[Parameter(Mandatory = $true)]
42+
[pscredential]$MSTCredential,
43+
[string]$Policy,
44+
[string]$TenantID
45+
)
46+
47+
Import-Module microsoftteams
48+
49+
try{
50+
ConnectMSTeams -MTCredential $MSTCredential -TenantID $TenantID
51+
52+
[hashtable]$getArgs = @{'ErrorAction' = 'Stop'}
53+
54+
if([System.String]::IsNullOrWhiteSpace($Policy) -eq $false){
55+
$getArgs.Add('Identity',$Policy)
56+
}
57+
58+
$result = @()
59+
$null = Get-CsPolicyPackage @getArgs | Select-Object * | ForEach-Object{
60+
$result += [pscustomobject]@{
61+
Name = $_.Name
62+
Description = $_.Description
63+
PackageType = $_.PackageType
64+
RecommendationType = $_.RecommendationType
65+
Policies = ($_.Policies.Keys -join ';')
66+
}
67+
}
68+
ConvertTo-ResultHtml -Result $result
69+
}
70+
catch{
71+
throw
72+
}
73+
finally{
74+
DisconnectMSTeams
75+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#Requires -Version 5.0
2+
#Requires -Modules microsoftteams
3+
4+
<#
5+
.SYNOPSIS
6+
Generates a report with the channels for a team
7+
8+
.DESCRIPTION
9+
10+
.NOTES
11+
This PowerShell script was developed and optimized for ScriptRunner. The use of the scripts requires ScriptRunner.
12+
The customer or user is authorized to copy the script from the repository and use them in ScriptRunner.
13+
The terms of use for ScriptRunner do not apply to this script. In particular, ScriptRunner Software GmbH assumes no liability for the function,
14+
the use and the consequences of the use of this freely available script.
15+
PowerShell is a product of Microsoft Corporation. ScriptRunner is a product of ScriptRunner Software GmbH.
16+
© ScriptRunner Software GmbH
17+
18+
.COMPONENT
19+
Requires Module microsoftteams
20+
Requires Library script MSTLibrary.ps1
21+
Requires Library Script ReportLibrary from the Action Pack Reporting\_LIB_
22+
23+
.LINK
24+
https://github.com/scriptrunner/ActionPacks/tree/master/O365/MS-Teams/_REPORTS_
25+
26+
.Parameter MSTCredential
27+
[sr-en] Provides the user ID and password for organizational ID credentials
28+
[sr-de] Enthält den Benutzernamen und das Passwort für die Anmeldung
29+
30+
.Parameter GroupId
31+
[sr-en] Specify the GroupId of the team
32+
[sr-de] Gibt die Gruppen-Id des Teams an
33+
34+
.Parameter TenantID
35+
[sr-en] Specifies the ID of a tenant
36+
[sr-de] ID eines Mandanten
37+
#>
38+
39+
[CmdLetBinding()]
40+
Param(
41+
[Parameter(Mandatory = $true)]
42+
[pscredential]$MSTCredential,
43+
[Parameter(Mandatory = $true)]
44+
[string]$GroupId,
45+
[string]$TenantID
46+
)
47+
48+
Import-Module microsoftteams
49+
50+
try{
51+
ConnectMSTeams -MTCredential $MSTCredential -TenantID $TenantID
52+
53+
[hashtable]$cmdArgs = @{'ErrorAction' = 'Stop'
54+
'GroupId' = $GroupId
55+
}
56+
57+
$result = Get-TeamChannel @cmdArgs | Select-Object DisplayName,Description,ID
58+
59+
ConvertTo-ResultHtml -Result $result
60+
}
61+
catch{
62+
throw
63+
}
64+
finally{
65+
DisconnectMSTeams
66+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#Requires -Version 5.0
2+
#Requires -Modules microsoftteams
3+
4+
<#
5+
.SYNOPSIS
6+
Generates a report with the users of a team
7+
8+
.DESCRIPTION
9+
10+
.NOTES
11+
This PowerShell script was developed and optimized for ScriptRunner. The use of the scripts requires ScriptRunner.
12+
The customer or user is authorized to copy the script from the repository and use them in ScriptRunner.
13+
The terms of use for ScriptRunner do not apply to this script. In particular, ScriptRunner Software GmbH assumes no liability for the function,
14+
the use and the consequences of the use of this freely available script.
15+
PowerShell is a product of Microsoft Corporation. ScriptRunner is a product of ScriptRunner Software GmbH.
16+
© ScriptRunner Software GmbH
17+
18+
.COMPONENT
19+
Requires Module microsoftteams
20+
Requires Library script MSTLibrary.ps1
21+
Requires Library Script ReportLibrary from the Action Pack Reporting\_LIB_
22+
23+
.LINK
24+
https://github.com/scriptrunner/ActionPacks/tree/master/O365/MS-Teams/_REPORTS_
25+
26+
.Parameter MSTCredential
27+
[sr-en] Provides the user ID and password for organizational ID credentials
28+
[sr-de] Enthält den Benutzernamen und das Passwort für die Anmeldung
29+
30+
.Parameter GroupId
31+
[sr-en] Specify the specific GroupId of the team
32+
[sr-de] Gibt die Gruppen-Id des Teams an
33+
34+
.Parameter Role
35+
[sr-en] Filter the results to only users with the given role
36+
[sr-de] Nur Benutzer der angegebenen Rolle
37+
38+
.Parameter TenantID
39+
[sr-en] Specifies the ID of a tenant
40+
[sr-de] ID eines Mandanten
41+
#>
42+
43+
[CmdLetBinding()]
44+
Param(
45+
[Parameter(Mandatory = $true)]
46+
[pscredential]$MSTCredential,
47+
[Parameter(Mandatory = $true)]
48+
[string]$GroupId,
49+
[ValidateSet('Member','Owner','Guest')]
50+
[string]$Role,
51+
[string]$TenantID
52+
)
53+
54+
Import-Module microsoftteams
55+
56+
try{
57+
ConnectMSTeams -MTCredential $MSTCredential -TenantID $TenantID
58+
59+
[hashtable]$cmdArgs = @{'ErrorAction' = 'Stop'
60+
'GroupId' = $GroupId
61+
}
62+
63+
$team = Get-Team @cmdArgs | Select-Object -ExpandProperty DisplayName
64+
65+
if([System.String]::IsNullOrWhiteSpace($Role) -eq $false){
66+
$cmdArgs.Add('Role',$Role)
67+
}
68+
69+
# $result = @("Users of the team $($team)", '')
70+
$result = Get-TeamUser @cmdArgs | Select-Object *
71+
72+
ConvertTo-ResultHtml -Result $result
73+
}
74+
catch{
75+
throw
76+
}
77+
finally{
78+
DisconnectMSTeams
79+
}

0 commit comments

Comments
 (0)