Created
November 11, 2020 00:49
-
-
Save pkbullock/cbe486795848b55c5dc5498b2a83c1c2 to your computer and use it in GitHub Desktop.
Get a list of groups that is associated to a team
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Connect-PnPOnline -ClientId c53eb8da-8bdf-44f9-8718-1fb1bbbbbb ` | |
-Thumbprint EC1E61510AEC35624AF78FEA763D00000000 ` | |
-Tenant "tenant.co.uk" -Url "https://tenant.sharepoint.com" | |
$token = Get-PnPGraphAccessToken | |
# Create header with the access token | |
$header = @{ Authorization = "Bearer $($token)" } | |
#v1.0/Beta | |
$uri = 'https://graph.microsoft.com/Beta/groups' + ` | |
'?$filter=resourceProvisioningOptions/Any(x:x eq ''Team'')' + | |
'&select=id,displayName' | |
# Make a simple rest call | |
$response = Invoke-RestMethod -Uri $uri -Headers $header -Method Get -ContentType "application/json" | |
# Lets see the result | |
$response.Value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment