How can I get the Azure Directory(Tenant) name in which I have logged in by PowerShell ?
I have tried 'Get-AzContext', but it only provides the Tenant ID. Tenant name or default domain name is not included in the output.
Get-AzTenant
will help.
Get-AzTenant
[[-TenantId] <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Make sure the version of Az is 4.5.0(the latest version).
You could Install-Module -Name Az
to update it.