Finding out what service created a SharePoint site

SharePoint is the underpinning data storage for many Microsoft 365 services. Sites are are therefore created under the hood by many services.

Sometimes it it useful to know from where a site was created. We can actually find this in the SharePoint Online Admin Center. The column is however hidden by default, so you need to click Customize Columns and select to show “Created From”:

Note: This is a fairly new feature. It appears to have been added late 2020. Sites created earlier will have and empty field.

What if we wanted to get this information programmatically for all sites? Here is a solution written in PowerShell with the help of PnP PowerShell. It uses a hidden list on the Admin Center that aggregates all site collections in your tenant. Here we can find a field called SiteCreationSource  which is what we are looking for:

Not too difficult. Note that “SiteCreationSource” returns a GUID. We need to map this to a service. In the code I have simply hardcoded a few services. To get a list with all available services, this list can be queried:

Finally I want to point out that the site aggregation list contains a lot of useful information (besides being the easiest way to get a list of all sites). Some other fields that might be of interest: AllowGuestUserSignIn, ChannelType, ChannelSitesCount, ConditionalAccessPolicy, CreatedBy, CreatedByEmail, DeletedBy, ExternalSharing, FileViewedOrEdited, GroupId, HubSiteId, Initiator, IsGroupConnected, LastActivityOn, NumOfFiles, PageViews, PagesVisited, SensitivityLabel, SiteCreationSource, SiteId, SiteUrl, SiteOwnerEmail, SiteOwnerName, State, StorageQuota, StorageUsed, StorageUsedPercentage, TemplateName, TimeCreated, TimeDeleted, & RelatedGroupId.

This entry was posted in Development and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *