Aug 21 2024 12:00 AM
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.
Aug 21 2024 07:11 AM
Solution
Ensure you have the necessary permissions for the Microsoft Graph API. For exporting group details, you typically need Group.Read.All
and User.Read.All
permission
Aug 21 2024 07:11 AM
Solution
Ensure you have the necessary permissions for the Microsoft Graph API. For exporting group details, you typically need Group.Read.All
and User.Read.All
permission