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 :

As of now (at least when I am writing this post), there is no direct Graph API or Powershell support to get this property. But you can extract this value from other properties, i.e., SharePoint URL, OneDrive URL and License SKU name.

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