Obtaining AzureAD GUID and Tenant Name

Ocassionaly you may find yourself in the need to obtain the Tenant GUID or Tenant Name for your AzureAD environment, but these details can be tricky to find. You can get this information using PowerShell.

I have found that both of these pieces of information are made available to you when you connect to AzureAD via PowerShell. To be able to do this you will need the AzuerAD PowerShell module. Use the following command to connect to AzureAD.

Connect-AzureAD

When you run the above command, you will be prompted to log in using Microsoft modern authentication and MFA if enabled. After sucessfully authenticating you will be returned a Microsoft.Open.Azure.AD.CommonLibrary.PSAzureContext object which includes the TenantId and TenantDomain properties.

Rich Carpenter

Richard is an Information Security Expert, focussed on the implementation and architecture of Digital Transformation and Public Cloud adoption at forward thinking organisations.