我的问题是:不使用powershell命令可以获得azure活动目录租户id吗?

我找到了这两个博客,有了这个帮助,我已经能够从powershell获得租户ID和订阅ID。这是找回房客的唯一方法吗?

在Windows PowerShell中获取Windows Azure活动目录租户ID

Windows Azure AD认证支持PowerShell

谢谢


当前回答

PowerShell:

Add-AzureRmAccount #if not already logged in 
Get-AzureRmSubscription -SubscriptionName <SubscriptionName> | Select-Object -Property TenantId

其他回答

我使用跟踪来获取租户id

az account show --query homeTenantId --output tsv

当您浏览给定的Active Directory实例时,租户id也会出现在管理控制台URL中,例如:

https://manage.windowsazure.com/<morestuffhere>/ActiveDirectoryExtension/Directory/BD848865-BE84-4134-91C6-B415927B3AB1

PowerShell:

Add-AzureRmAccount #if not already logged in 
Get-AzureRmSubscription -SubscriptionName <SubscriptionName> | Select-Object -Property TenantId

我的团队真的厌倦了为我们的O365和Azure项目寻找租户ID。开发人员、支持团队、销售团队,每个人都在某个时候需要它,但从来不记得该怎么做。

所以我们建立了这个小网站,与whatismyip.com相同。希望对你有用!

如何找到我的Microsoft 365、Azure或SharePoint在线租户ID?

通过PowerShell匿名:

(Invoke-WebRequest https://login.windows.net/YOURDIRECTORYNAME.onmicrosoft.com/.well-known/openid-configuration|ConvertFrom-Json).token_endpoint.Split('/')[3]