我的问题是:不使用powershell命令可以获得azure活动目录租户id吗?
我找到了这两个博客,有了这个帮助,我已经能够从powershell获得租户ID和订阅ID。这是找回房客的唯一方法吗?
在Windows PowerShell中获取Windows Azure活动目录租户ID
Windows Azure AD认证支持PowerShell
谢谢
我的问题是:不使用powershell命令可以获得azure活动目录租户id吗?
我找到了这两个博客,有了这个帮助,我已经能够从powershell获得租户ID和订阅ID。这是找回房客的唯一方法吗?
在Windows PowerShell中获取Windows Azure活动目录租户ID
Windows Azure AD认证支持PowerShell
谢谢
当前回答
我的团队真的厌倦了为我们的O365和Azure项目寻找租户ID。开发人员、支持团队、销售团队,每个人都在某个时候需要它,但从来不记得该怎么做。
所以我们建立了这个小网站,与whatismyip.com相同。希望对你有用!
如何找到我的Microsoft 365、Azure或SharePoint在线租户ID?
其他回答
如果您已经在您的机器中安装了Azure CLI 2.0,那么您应该能够使用以下命令获得您所属的订阅列表:
az login
如果你想看到一个表输出,你可以使用
az account get-access-token --query tenant --output tsv
或者你可以使用Rest API
租户-列表|微软文档
PowerShell:
Add-AzureRmAccount #if not already logged in
Get-AzureRmSubscription -SubscriptionName <SubscriptionName> | Select-Object -Property TenantId
步骤1:登录Microsoft Azure门户
步骤2:搜索Azure Active目录
步骤3:单击overview,从租户信息部分找到租户id
使用Azure门户:
步骤1:登录azure门户,搜索azure Active Directory并选择它。 Step2:在Azure Active Directory的概览页面中,找到租户ID。
使用Azure CLI:
使用命令az login、az account list或az account tenant list。在每个命令的输出中为每个订阅查找TenantId属性。
使用Powershell
在powershell cmdlet中使用以下命令。
Connect-AzAccount
Get-AzTenant
参考:
Azure CLI
Get-Aztenant
xxx@Azure:~$ az ad sp create-for-rbac
Retrying role assignment creation: 1/36
{
"appId": "401143c2-95ef-4792-9900-23e07f7801e7",
"displayName": "azure-cli-2018-07-10-20-31-57",
"name": "http://azure-cli-2018-07-10-20-31-57",
"password": "a0471d14-9300-4177-ab08-5c45adb3476b",
"tenant": "e569f29e-b008-4cea-b6f0-48fa8532d64a"
}