Skip to content

Commit 7868fc2

Browse files
Graph revoke user sessions
1 parent 533949f commit 7868fc2

File tree

66 files changed

+1980
-183
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1980
-183
lines changed

Diff for: MS Graph/Groups/Add-MGGGroupToLifecyclePolicy.ps1

-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
© ScriptRunner Software GmbH
1717
1818
.COMPONENT
19-
Requires Library script MS Graph\_LIB_\MGLibrary
2019
Requires Modules Microsoft.Graph.Groups
2120
2221
.LINK
@@ -35,7 +34,6 @@ param(
3534
Import-Module Microsoft.Graph.Groups
3635

3736
try{
38-
ConnectMSGraph
3937
[hashtable]$cmdArgs = @{ErrorAction = 'Stop'}
4038
$mgPol = Get-MgGroupLifecyclePolicy @cmdArgs
4139
$mgPol = Add-MgGroupToLifecyclePolicy @cmdArgs -GroupId $GroupId -GroupLifecyclePolicyId $mgPol.Id -Confirm:$false
@@ -51,5 +49,4 @@ catch{
5149
throw
5250
}
5351
finally{
54-
DisconnectMSGraph
5552
}

Diff for: MS Graph/Groups/Get-MGGAllGroupSite.ps1

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#Requires -Version 5.0
2+
#requires -Modules Microsoft.Graph.Groups
3+
4+
<#
5+
.SYNOPSIS
6+
Invoke function getAllSites
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 Modules Microsoft.Graph.Groups
20+
21+
.LINK
22+
https://github.com/scriptrunner/ActionPacks/tree/master/MS%20Graph/Groups
23+
24+
.Parameter GroupId
25+
[sr-en] Group identifier
26+
[sr-de] Gruppen ID
27+
#>
28+
29+
param(
30+
[Parameter(Mandatory = $true)]
31+
[string]$GroupId
32+
)
33+
34+
Import-Module Microsoft.Graph.Groups
35+
36+
try{
37+
[hashtable]$cmdArgs = @{ErrorAction = 'Stop'
38+
'GroupId' = $GroupId
39+
}
40+
$mgGroup = Get-MgAllGroupSite @cmdArgs | Select-Object *
41+
42+
if($null -ne $SRXEnv) {
43+
$SRXEnv.ResultMessage = $mgGroup
44+
}
45+
else{
46+
Write-Output $mgGroup
47+
}
48+
}
49+
catch{
50+
throw
51+
}
52+
finally{
53+
}

Diff for: MS Graph/Groups/Get-MGGGroup.ps1

+1-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
© ScriptRunner Software GmbH
1717
1818
.COMPONENT
19-
Requires Library script MS Graph\_LIB_\MGLibrary
2019
Requires Modules Microsoft.Graph.Groups
2120
2221
.LINK
@@ -33,14 +32,13 @@
3332

3433
param(
3534
[string]$GroupId,
36-
[ValidateSet('AcceptedSenders','CreatedDateTime','DeletedDateTime','Description','DisplayName','Id','IsArchived','Mail','MailEnabled','MailNickname','MemberOf','Members','Owners','Specialization','Visibility','GroupTypes','PreferredLanguage','ProxyAddresses','RenewedDateTime','SecurityEnabled','SecurityIdentifier')]
35+
[ValidateSet('AcceptedSenders','CreatedDateTime','DeletedDateTime','Description','DisplayName','Id','IsArchived','Mail','MailEnabled','MailNickname','MemberOf','Members','Owners','Visibility','GroupTypes','PreferredLanguage','ProxyAddresses','RenewedDateTime','SecurityEnabled','SecurityIdentifier')]
3736
[string[]]$Properties = @('DisplayName','Id','Description','CreatedDateTime','Mail','MailEnabled')
3837
)
3938

4039
Import-Module Microsoft.Graph.Groups
4140

4241
try{
43-
ConnectMSGraph
4442
[hashtable]$cmdArgs = @{ErrorAction = 'Stop'}
4543
if($PSBoundParameters.ContainsKey('GroupID') -eq $true){
4644
$cmdArgs.Add('GroupId',$GroupId)
@@ -65,5 +63,4 @@ catch{
6563
throw
6664
}
6765
finally{
68-
DisconnectMSGraph
6966
}

Diff for: MS Graph/Groups/Get-MGGGroupAcceptedSender.ps1

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
© ScriptRunner Software GmbH
1717
1818
.COMPONENT
19-
Requires Library script MS Graph\_LIB_\MGLibrary
2019
Requires Modules Microsoft.Graph.Groups
2120
2221
.LINK
@@ -35,9 +34,9 @@ param(
3534
Import-Module Microsoft.Graph.Groups
3635

3736
try{
38-
ConnectMSGraph
3937
[hashtable]$cmdArgs = @{ErrorAction = 'Stop'
4038
'GroupId'= $GroupId
39+
'All' = $null
4140
}
4241
$result = Get-MgGroupAcceptedSender @cmdArgs | Select-Object *
4342

@@ -52,5 +51,4 @@ catch{
5251
throw
5352
}
5453
finally{
55-
DisconnectMSGraph
5654
}

Diff for: MS Graph/Groups/Get-MGGGroupAcceptedSenderCount.ps1

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#Requires -Version 5.0
2+
#requires -Modules Microsoft.Graph.Groups
3+
4+
<#
5+
.SYNOPSIS
6+
Get the number of the resource
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 Modules Microsoft.Graph.Groups
20+
21+
.LINK
22+
https://github.com/scriptrunner/ActionPacks/tree/master/MS%20Graph/Groups
23+
24+
.Parameter GroupId
25+
[sr-en] Group identifier
26+
[sr-de] Gruppen ID
27+
#>
28+
29+
param(
30+
[Parameter(Mandatory = $true)]
31+
[string]$GroupId
32+
)
33+
34+
Import-Module Microsoft.Graph.Groups
35+
36+
try{
37+
[hashtable]$cmdArgs = @{ErrorAction = 'Stop'
38+
'GroupId'= $GroupId
39+
}
40+
$result = Get-MgGroupAcceptedSenderCount @cmdArgs | Select-Object *
41+
42+
if($SRXEnv) {
43+
$SRXEnv.ResultMessage = $result
44+
}
45+
else{
46+
Write-Output $result
47+
}
48+
}
49+
catch{
50+
throw
51+
}
52+
finally{
53+
}

Diff for: MS Graph/Groups/Get-MGGGroupConversation.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
© ScriptRunner Software GmbH
1717
1818
.COMPONENT
19-
Requires Library script MS Graph\_LIB_\MGLibrary
2019
Requires Modules Microsoft.Graph.Groups
2120
2221
.LINK
@@ -46,13 +45,15 @@ param(
4645
Import-Module Microsoft.Graph.Groups
4746

4847
try{
49-
ConnectMSGraph
5048
[hashtable]$cmdArgs = @{ErrorAction = 'Stop'
5149
'GroupId'= $GroupId
5250
}
5351
if($PSBoundParameters.ContainsKey('ConversationId') -eq $true){
5452
$cmdArgs.Add('ConversationId',$ConversationId)
5553
}
54+
else{
55+
$cmdArgs.Add('All',$null)
56+
}
5657

5758
$result = Get-MgGroupConversation @cmdArgs | Select-Object $Properties
5859
if($SRXEnv) {
@@ -66,5 +67,4 @@ catch{
6667
throw
6768
}
6869
finally{
69-
DisconnectMSGraph
7070
}

Diff for: MS Graph/Groups/Get-MGGGroupConversationCount.ps1

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#Requires -Version 5.0
2+
#requires -Modules Microsoft.Graph.Groups
3+
4+
<#
5+
.SYNOPSIS
6+
Get the number of the resource
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 Modules Microsoft.Graph.Groups
20+
21+
.LINK
22+
https://github.com/scriptrunner/ActionPacks/tree/master/MS%20Graph/Groups
23+
24+
.Parameter GroupId
25+
[sr-en] Group identifier
26+
[sr-de] Gruppen ID
27+
#>
28+
29+
param(
30+
[Parameter(Mandatory = $true)]
31+
[string]$GroupId
32+
)
33+
34+
Import-Module Microsoft.Graph.Groups
35+
36+
try{
37+
[hashtable]$cmdArgs = @{ErrorAction = 'Stop'
38+
'GroupId'= $GroupId
39+
}
40+
$result = Get-MgGroupConversationCount @cmdArgs | Select-Object *
41+
42+
if($SRXEnv) {
43+
$SRXEnv.ResultMessage = $result
44+
}
45+
else{
46+
Write-Output $result
47+
}
48+
}
49+
catch{
50+
throw
51+
}
52+
finally{
53+
}

Diff for: MS Graph/Groups/Get-MGGGroupConversationThread.ps1

+2-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
© ScriptRunner Software GmbH
1717
1818
.COMPONENT
19-
Requires Library script MS Graph\_LIB_\MGLibrary
2019
Requires Modules Microsoft.Graph.Groups
2120
2221
.LINK
@@ -47,13 +46,13 @@ param(
4746
Import-Module Microsoft.Graph.Groups
4847

4948
try{
50-
ConnectMSGraph
5149
[hashtable]$cmdArgs = @{ErrorAction = 'Stop'
5250
'GroupId'= $GroupId
5351
'ConversationId' = $ConversationId
52+
'All' = $null
5453
}
55-
5654
$result = Get-MgGroupConversationThread @cmdArgs | Select-Object $Properties
55+
5756
if($SRXEnv) {
5857
$SRXEnv.ResultMessage = $result
5958
}
@@ -65,5 +64,4 @@ catch{
6564
throw
6665
}
6766
finally{
68-
DisconnectMSGraph
6967
}
+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#Requires -Version 5.0
2+
#requires -Modules Microsoft.Graph.Groups
3+
4+
<#
5+
.SYNOPSIS
6+
Get the number of the resource
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 Modules Microsoft.Graph.Groups
20+
21+
.LINK
22+
https://github.com/scriptrunner/ActionPacks/tree/master/MS%20Graph/Groups
23+
24+
.Parameter GroupId
25+
[sr-en] Group identifier
26+
[sr-de] Gruppen ID
27+
28+
.Parameter ConversationId
29+
[sr-en] Conversation identifier
30+
[sr-de] Konversation ID
31+
#>
32+
33+
param(
34+
[Parameter(Mandatory = $true)]
35+
[string]$GroupId,
36+
[Parameter(Mandatory = $true)]
37+
[string]$ConversationId
38+
)
39+
40+
Import-Module Microsoft.Graph.Groups
41+
42+
try{
43+
[hashtable]$cmdArgs = @{ErrorAction = 'Stop'
44+
'GroupId'= $GroupId
45+
'ConversationId' = $ConversationId
46+
}
47+
$result = Get-MgGroupConversationThreadCount @cmdArgs | Select-Object *
48+
49+
if($SRXEnv) {
50+
$SRXEnv.ResultMessage = $result
51+
}
52+
else{
53+
Write-Output $result
54+
}
55+
}
56+
catch{
57+
throw
58+
}
59+
finally{
60+
}

0 commit comments

Comments
 (0)