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

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

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

Windows Azure AD认证支持PowerShell

谢谢


当前回答

使用Azure CLI

az account get-access-token --query tenant --output tsv

其他回答

我使用跟踪来获取租户id

az account show --query homeTenantId --output tsv

获取tenantID的简单方法是:

Connect-MsolService -cred $LiveCred  #sign in to tenant

(Get-MSOLCompanyInformation).objectid.guid  #get tenantID

PowerShell:

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

一键回答:

打开这个URL:

https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/Properties

For AAD-B2C it is fairly simple. From Azure Portal with a B2C directory associated, go to your B2C directory (I added the "Azure AD B2C" to my portal's left menu). In the B2C directory click on "User flows (policies) directory menu item. In the policies pane click on one of your policies you previously added to select it. It should open a pane for the policy. Click "Properties". In the next pane is a section, "Token compatibility settings" which has a property "Issuer". Your AAD-B2C tenant GUID is contained in the URL.