MGDC for SharePoint FAQ: Is OneDrive included?

This post has been republished via RSS; it originally appeared at: Microsoft Tech Community - Latest Blogs - .

1. SharePoint datasets and OneDrive


When I describe the SharePoint datasets in Microsoft Graph Data Connect to someone, I frequently get this question: do Sites and Sharing Permissions cover only SharePoint or do they include OneDrive? The short answer is that OneDrive is included, but there is much more to say here…


2. OneDrive is a type of SharePoint site


For most technical intents and purposes, a OneDrive in your Microsoft 365 tenant is a SharePoint site with a specific template and permissions. It is basically a SharePoint site collection for personal use that comes preconfigured with permissions for the owner and nobody else. After that, you can upload/create files and decide to keep them private or share with others from there.


This special type of site was initially called a “Personal Site”, later was referred to as a “My Site” or “MySite”, then a “OneDrive for Business” (commonly abbreviated to “ODfB” or simply “ODB”). These days, we usually just call it a OneDrive and you can figure out if we’re talking about the consumer or business variety based on context.


Along the way, the purpose has always been the same. To allow someone in a tenant to store information needed for your personal work, with the ability to share with others as necessary. As the name suggests, it’s your single drive in the cloud to store all your business-related personal files.


The personal sites for each user are typically created only when the user tries to access their OneDrive for the first time. SharePoint does offer administrators a mechanism to pre-provision accounts. You can read more about it at


But keep in mind that, when you use the Microsoft Graph Data Connect to pull the Sites dataset, you get all types of sites in the tenant and that does include OneDrives.


3. How can you tell them apart?


In the Sites dataset, you can tell a site is a OneDrive by looking at the RootWeb.WebTemplate (which is “SPSPERS” for OneDrive) or the RootWeb.WebTemplateId (which is 21 for OneDrive). Note that these are properties of the Root Web for the site (more on this later).


For the other Microsoft Graph Data Connect for SharePoint datasets, you can use the SiteId property to join with the Sites dataset and find the Template or Template Id. This is a reliable method and the recommended one.


Some of the datasets might also have a URL property which can be used to identify a OneDrive. For the Sharing Permissions dataset, for instance, an ItemURL that starts with “personal/” indicates a permission for a OneDrive. You can read more about OneDrive URLs at


Using the URL is probably OK for most tenants using OneDrive but might not work for other site types.


4. Root Web


It is good to clarify why the Template and TemplateId properties come from the RootWeb property and it’s not a property of the site itself.


For starters, it’s important to understand the main SharePoint entities:

  1. There are many tenants.
  2. Tenants have Sites, also known as Site Collections.
  3. Sites (Site Collections) have Webs, also known as Subsites.
  4. Webs (Subsites) have Lists, some of which are called libraries or document libraries.
  5. Lists have List Items (document libraries have folders and documents)


As you can see, there is a hierarchy.





The relationship between Sites and Webs is particularly interesting. When you create a Site, you must tell SharePoint the type of Site you want. That is used to create the Site and the main Web inside, called the RootWeb.


Every Site Collection has at least one Web and most have only one (the Root Web). The Site’s name and type (template) ends up being stored in the Root Web. Most templates don’t even have an option to add more webs (subsites). I would recommend keeping things simple and having only one web per site.


Note: You will sometimes hear people refer to Webs as Sites, which is a term normally used for Site Collections. Since most Site Collections have only one Web, that is typically not a big issue. That can get a little confusing at times, so you might want to stick to using the unambiguous terms “Site Collections” and “Webs” to be extra clear.


5. Web Templates


When you create a Site Collection and its corresponding Root Web, you must choose a Web Template. Each Web Template comes with a few default lists and libraries.


Some of these Web Templates (like Team Sites and Communication Sites) help you get started with a new Site. Others are not meant to be created by end users but are used for specific scenarios (like the Compliance Policy Center, the Search Center or the Tenant Admin Site). As we mentioned before, one of these templates is the Personal Site or OneDrive.


Here’s a list of some common Web Templates used by SharePoint Online:


Web Template Id Web Template Description
1 STS Classic Team Site
16 TENANTADMIN Tenant Admin Site
18 APPCATALOG App Catalog Site
21 SPSPERS OneDrive (Personal Site)
56 ENTERWIKI Enterprise Wiki
64 GROUP Office 365 group-connected Team Site
68 SITEPAGEPUBLISHING Communication site
69 TEAMCHANNEL Team Channel
90 SRCHCENTERLITE Basic Search Center
301 REDIRECTSITE Redirect Site
3500 POLICYCTR Compliance Policy Center


Note: There are many more of these templates, not only the ones listed above. You can get a list of the templates available to you using the Get-SPOWebTemplate PowerShell cmdlet:


> Install-Module -Name Microsoft.Online.SharePoint.PowerShell
> Connect-SPOService -url
> Get-SPOWebTemplate | Select Name,Title | Sort Name | Format-List

Name  : BDR#0
Title : Document Center

Name  : BICenterSite#0
Title : Business Intelligence Center

Title : Publishing Portal

Title : Community Site

Title : Community Portal

Name  : DEV#0
Title : Developer Site

Name  : EHS#1
Title : Team Site - SharePoint Online configuration

Title : Enterprise Wiki

Name  : OFFILE#1
Title : Records Center

Title : Product Catalog

Title : Project Site

Title : Communication site

Name  : SRCHCEN#0
Title : Enterprise Search Center

Title : Basic Search Center

Name  : STS#0
Title : Team site (classic experience)

Name  : STS#3
Title : Team site (no Microsoft 365 group)

Name  : visprus#0
Title : Visio Process Repository


6. They are all in there…


So, I hope it’s clear that the Microsoft Graph Data Connect for SharePoint datasets (like Sites, Sharing Permissions and Groups) include information for all types of sites in the tenant, regardless of the Template they use. You can use the Sites dataset to understand Team Sites, OneDrives, and Communication Sites. The Sharing Permissions dataset includes permissions for all these different types of sites.


Note: For more information, visit the main blog at Links about SharePoint on MGDC.

Leave a Reply

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


This site uses Akismet to reduce spam. Learn how your comment data is processed.