Forum Discussion
M365 group to export the list with owner
Hi there, i would like to export out the m365 groups ( a lot) with owner email address.
and i see this page, https://github.com/12Knocksinna/Office365itpros/blob/master/TeamsGroupsActivityReportV5.PS1
i try to run it, but seems like i have permission issue.
Checking Microsoft 365 Groups and Teams for:
This phase can take some time because we need to fetch every group in the organization and
then analyze its settings and activity. Please wait.
Get-GraphData : System.Net.WebException: The remote server returned an error: (403) Forbidden.
at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request)
at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()
At D:\TeamsGroupsActivityReportV5.PS1:330 char:18
+ [array]$Groups = Get-GraphData -AccessToken $Token -Uri $uri
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-GraphData
Can't find any Microsoft 365 Groups - Check your access token
i have no idea how to find out which permission is needed as there are a lots of permission for microsoft graph.
i try to check the link inside the script and use the graph explorer, it also needed the permission.
Ensure you have the necessary permissions for the Microsoft Graph API. For exporting group details, you typically need
Group.Read.All
andUser.Read.All
permission
1 Reply
Ensure you have the necessary permissions for the Microsoft Graph API. For exporting group details, you typically need
Group.Read.All
andUser.Read.All
permission