I am working on PowerShell script where I have to get the all the O365 groups using PowerShell with minimal permission.
Please share the supporting articles to get the O365 groups and permission required
You could use the Get-UnifiedGroup
cmdlet to view Microsoft 365 Groups.
Reference:
https://docs.microsoft.com/en-us/powershell/module/exchange/get-unifiedgroup?view=exchange-ps
To add to the answer above here is an example of a script using Get-UnifiedGroup
#Get Credentials to connect
$Credential = Get-Credential
#Create the session
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ `
-Credential $Credential -Authentication Basic -AllowRedirection
#Import the session
Import-PSSession $Session -DisableNameChecking
#Get all Office 365 Group
Get-UnifiedGroup
#Remove the session
Remove-PSSession $Session
I am unsure of what permissions are needed however.
https://www.sharepointdiary.com/ is a great resource for all things SharePoint and PowerShell related