Query Office 365 Tenant ID
The Office 365 Tenant ID is pretty good hidden. Therefore here are two was finding out what's your Tenant ID ist.
Open PowerShell and login into Office 365
Connect-MsolService -Credential $credential
$TenantID = (Invoke-WebRequest https://login.windows.net/YourOFFICE365TenantName.onmicrosoft.com/.well-known/openid-configuration|ConvertFrom-Json).token_endpoint.Split(‘/’)
Finding the Tenant ID in SharePoint
Author: Thomas Poett MVP, Business Unit Lead Microsoft Unified Communication