powershell - Get-AzureRmADServicePrincipal 和 Get-AzureADServicePrincipal 之间有什么区别?

标签 powershell azure azure-active-directory azure-web-app-service powershell-2.0

我编写了 powershell 脚本来根据 appId 读取服务主体,如下所示:

$DirectoryApp = Get-AzureADServicePrincipal | where AppId -eq $DirectoryAppId

但我找不到服务主体来读取创建 azure 广告应用程序的权限。有趣的是,如果我使用服务主体对象 ID 可以检索服务主体。在这种情况下,什么会影响不读取基于

的服务主体
$DirectoryAppId = 00000002-0000-0000-c000-000000000000

我还看到两种不同的方法,Get-AzureRmADServicePrincipalGet-AzureADServicePrincipal

Get-AzureRmADServicePrincipalGet-AzureADServicePrincipal 之间有什么区别?

最佳答案

首先,如何通过Applicaiton Id获取一个sp:

Azure RM Powershell:

$sp =  Get-AzureRmADServicePrincipal | Where-Object{$_.ApplicationId -eq "00000000-c781-4224-9b91-ad15a8179ba0"}

Azure AD Powershell:

$sp = Get-AzureADServicePrincipal | Where-Object{$_.AppId -eq "00000000-c4e2-40cb-96a7-ac90df92685c"}

What is the difference beteween Get-AzureRmADServicePrincipal and Get-AzureADServicePrincipal ?

这两个命令来自不同的 Powershell 模块。

Get-AzureRmADServicePrincipal 来自Azure RM Powershell .

Get-AzureADServicePrincipal 来自Azure AD Powershell .

如果只想使用 AAD,Azure AD Powershell 更好。如果您想通过 Poweshell 使用 Azure 订阅和 AAD 的分离功能,Azure RM powershell 更好。

关于powershell - Get-AzureRmADServicePrincipal 和 Get-AzureADServicePrincipal 之间有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50985013/

相关文章:

azure - 如何使用 Azure Active Directory 设置 Ocelot Api Gateway

azure - AAD B2C : After "reset password" from Azure Portal the B2C users cannot change it while loging in by SignIn policy URL

json - 使用 Powershell,如何将 Azure AD 组成员转换为 Json 对象(文件),然后进行更新?

powershell - 在 Nano 服务器中设置机器范围的环境变量

sql - 变量名称在查询批处理或存储过程中必须是唯一的吗?

Azure 存储帐户创建需要大量时间

azure - Windows Azure - 我可以在同一 VM 上运行 Web 角色和辅助角色吗?

powershell - 如何列出Azure Function App中的所有函数

sql - 无法使数据库在Powershell中写入CSV

azure - MSAL Azure B2C : which field do I send as bearer token to make authorized API requests?