In this blog post, I will show you how to get your tenant ID for Azure and Office 365 using Microsoft PowerShell.
For this demonstration, I will use the Azure PowerShell command-line utility that runs on PowerShell 7. The great advantage of using PowerShell 7 with Azure PowerShell is that it is a cross-platform utility which means that we can run it on Windows, Linux and macOS.
After installing PowerShell 7 and Azure PowerShell connect to the platform using the following cmdlet.
Get Tenant ID
To get your tenant ID run the following cmdlet.
get-aztenant | fl
The output will display the ID value and a few critical values that are related to your tenant.