The Azure Tenant ID is a Global Unique Identifier (GUID) for your Microsoft 365 Tenant. It’s also referred to as the Office 365 Tenant ID. The ID is used to identify your tenant and it’s not your organization name or domain name.
There are different ways to get your Azure Tenant ID. You can find it in one of the Azure portals or with PowerShell. I have listed each option for you, so you can choose what works best for you.
Get the Azure Tenant ID
Time needed:Â 2 minutes.
The simplest way to get your Azure Tenant Id is from the Azure Admin center.
- Log in at portal.azure.com
- Search for Tenant in the top search bar
- Select Tenant Properties
- Get (copy) your Azure Tenant ID
Find the id in Azure Active Directory
You can also find the id in the Azure Active Directory (AAD).
- Log in at aad.portal.azure.com
- Select Azure Active Directory on the left side
- Open Properties to find the Tenant Id
Using PowerShell to find the Tenant Id
We can use different Office 365 PowerShell modules to get the Azure Tenant Id, like Msol or Azure AD. But you actually don’t need any module to get the id. The following single line cmdlet will return your id without logging in or using any modules.
Just make sure you replace Contoso with your Office 365 domain name
# Replace CONTOSO with your domain name (Invoke-WebRequest https://login.windows.net/CONTOSO.onmicrosoft.com/.well-known/openid-configuration | ConvertFrom-Json).token_endpoint.Split('/')[3]
Using Microsoft Online Service module
We can also use the Msol service in PowerShell to get the tenant Id. Make sure you are connected to Msol.
# Connect to Msol Connect-MsolService # Get tenant id (Get-MSOLCompanyInformation).objectid.guid
Another option is the extract the tenant id from the AccountSku. You will find the tenant id in the AccountObjectId
Get-MsolAccountSku | fl
Using AzureAD to get Office 365 tenant id
The AzureAd module in PowerShell is used to work with the Azure Active Directory, so of course, we can get the tenant id with it.
# If you are NOT connected to AzureAd yet Connect-AzureAd | Select TenantId # If you already have a connection Get-AzureADTenantDetail
Wrapping Up
The Azure Tenant Id is pretty easy to find these days. If you have any questions or other useful methods to get it, then just drop a comment below.