Friday, 12 July 2019

How to find your tenant name in Office 365

You might have heard the terms tenant name and domain name in Office 365 and Azure AD. You may feel both are the same, but this is not correct. When you sign up for Office 365, you will be asked for your organization name (i.e., contoso). Based on this organization name, Azure AD service will allocate a "tenant name" and it will also create a default domain for your tenant, the domain name will be the same as your tenant name, but with the suffix domain "".

For example, if you have created organization with the name "contoso", then

Your tenant name is : contoso
Default domain name is :

You can purchase and add custom domains with different names under this domain, but you can't change the tenant name.

Why tenant name is important :

The tenant name will be used in your SharePoint and OneDrive Site URL.
SharePoint URL :
SPO Site URL :
SPO Admin Site URL :
OneDrive URL :
So if you planned to use these services, then you have to carefully choose your organization name. For example, if you chose "contoso" as your organization name during Office 365 signup, then contoso will become your "tenant name". Even if you add custom domain "", you cannot change tenant name in your SharePoint URL to "".

How to retrieve your Office 365 tenant name :

We can extract the tenant name in different ways (i.e. Graph API, Powershell , from SharePoint and OneDrive URL).

Using Microsoft Graph API:

We can use the following Microsoft Graph API endpoints to find the tenant name from verifiedDomains list.

Get organization endpoint:
#Select only verifiedDomains property$select=verifiedDomains
List domains endpoint:
Both endpoints return all the verified domains in your organization. You have to look for the initial domain ("isInitial": true) from the domains list, the initial domain name is your full tenant domain name and removing the subdomain part "" will provide the tenant name of your organization.
 "capabilities": "Email, OfficeCommunicationsOnline",
 "isDefault": false,
 "isInitial": true,
 "name": "",
 "type": "Managed"
From the above result :

Tenant domain name is: ""
Tenant name is: "contoso"

From OneDrive Site URL :

Open your OneDrive for Business site in a web browser and your browser URL will look like below URL. The first part of the URL before -my.sharepoint is tenant name.
How to find your tenant name from OneDrive URL

From SharePoint Site URL :

Open one of your SharePoint Online site in a web browser and your browser URL will look like below URL. Here the first part of the URL before .sharepoint is tenant name.
How to find my tenant name from SharePoint Site URL

From License SKU ID using Powershell:

The license SKU names are prefixed with your tenant name, so you can list the available license SKUs by running the Get-MsolAccountSku cmdlet and the first part of the AccountSkuID is the tenantname.

Open Powershell with "Run as administrator" privilege and run the below command to install the MSOnline Powershell module if you have not already installed.
Install-Module MSOnline
Run the below commands to list the available license SKUs.
How to find my tenant name using Powershell


No comments:

Post a Comment