Restful API或者Powershellshell
https://login.windows.net/[YOURDIRECTORYNAME].onmicrosoft.com/.well-known/openid-configuration。例如:https://login.windows.net/contoso.onmicrosoft.com/.well-known/openid-configuration 返回的信息中包含了contoso的tenant id。其實,直接訪問上面的URL也能夠獲得tenant id,下面的Powershell在這裏只是幫助你快速找到返回信息中的tenant id。windows
(Invoke-WebRequesthttps://login.windows.net/[YOURDIRECTORYNAME].onmicrosoft.com/.well-known/openid-configuration|ConvertFrom-Json).token_endpoint.Split('/')[3]api
Azure Portalapp
Azure Portal的Azure Active Directory擴展中也能夠直接找到tenant id.運維