1

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

2 Answers 2

2

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

3
  • Which minimal permission required to run the command. As I have only SharePoint Site collection admin. Client not going to provide high level permission to us Sep 24, 2020 at 18:04
  • As SharePoint site collection admin, You can only get users/groups in the site. it's not possible to get the all the O365 groups. You need to have tenant access. Sep 25, 2020 at 9:24
  • Thanks for the Updates Sep 28, 2020 at 6:41
1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.