Get Azure Active Directoy Tenant ID and Subscription ID

Contents
1
Install-Module -Name Az -AllowClobber -Scope CurrentUser

To get your Tenant ID / Name and Subscription ID / Name you have several options with PowerShell, one option is using

1
Connect-AzAccount

which directly gives you your default Subscription Name as well as your default Tenant ID after logging in.

Another option is using

1
Get-AzContext | Select-Object *

which gets the metadata used to authenticate Azure Resource Manager requests.

Some more details you get with

1
Get-Aztenant

which gets tenants that are authorized for your current user.