Office 365 Groups report does not bring all sites with template Group#0

Brass Contributor

Hi,

I am trying to pull Office 365 Groups and all site collections report via PowerShell. This is how I did it:

  • To get details about all O365 groups (please note that I cannot use EXO cmdlets due to some reasons) I am using this query "Get-AzureADMSGroup -All:$True | Where {($_.GroupTypes -eq 'Unified')}" and getting all required details of groups but this does not give associated site urls so I used graph query to get associated site urls of each Office 365 group. So I got the full list of Office 365 groups
  • Then to get all sites information from Tenant I used PnP PS module and I got all required information along with site template name. 

Here is the issue: When I count the no. of sites with template = GROUP#0 returned in second report (via PnP), the count is not the same as no. of groups found in first report. There is a difference around 200. Is there any possibility that Group connected site can be created even without having group type = UnifiedGroup? What am I missing here?

 

-Prashant.

4 Replies
Have you tried to get the list of modern sites from the new SPO Admin Center and compare this list against what you get with PS?

Thanks. I will check that.

Is there any possibility that we can get the Group details using SPO URL like Alias, group id etc.

If you cannot use the ExO PowerShell cmdlets, your best bet is the Graph API. Or use the built-in reports as Juan suggested.

Ok so I got the group details based on SPO site url via site property bag keys "GroupId" and "GroupAlias". I will further investigate this.