How to get list of sites created by Office 365 Groups

Posted by Beau Cameron on 02.07.17
Beau Cameron
Find me on:

The introduction of Office365 groups has been mostly positive. Office365 groups provide a new way for teams to collaborate together using the integration of various Office365 tools. These tools include document libraries, Outlook integration, OneNote and more recently Team Sites (new site collections).The latest introduction of Team Sites to Office365 groups allows teams more flexibility to collaborate on work together using native SharePoint site collections. There is one down side to Office365 groups... everyone can create a group...and this is where the problem starts.



The ability for anyone to create groups allows the flexibility for users in your site to start working right away with team members without having to wait for IT Pro intervention. The downside is what I am calling "Group Sprawl". One of the most important and difficult things to manage in your SharePoint/Office365 environment is Governance.

By allowing anyone to create a group and subsquently a team site, means the possiblity of mismanaged sites and hundreds spawling site collections in your web application.

Because your environment is at risk of sprawling site collections... An IT Pro will want to know how many group team sites are being created and what their URLs are... so they quickly jump to the admin center https://yoursite-admin.sharepoint and start looking for Office365 Group site collections... but wait, they aren't there!

"What do you mean they aren't there?"

That's right! They are hidden in the admin center, so you will not be able to see your group site collections. So how do you get a footprint of your SharePoint sites created through groups?

Luckily, you can execute some REST calls on your admin center using the SharePoint Search REST API!

The following command is your new best friend:

https://yoursite-admin.sharepoint.com/_api/search/query?querytext='contentclass:sts_site WebTemplate:GROUP'

This search query will return all Site Collections in your tenant (which do not show in the admin center) that were created via an Office365 group! So what you can do is create a maintenance page with a Content Search Web Part on it to show a list of all your Site Collections created by Office365 groups! See below:

cswp.png

 


I hope this helps someone! If you know another way (an easier way) of getting this information let me know!


 I

Topics: Development

Subscribe Here!

Recent Posts

Posts by Tag

See all