使用 PowerShell 从 SAML Entra 应用程序配置中读取“属性和声明”

问题描述 投票:0回答:1

我想使用 PowerShell 从 SAML 企业应用程序配置中读取“属性和声明”。

我找到了图形命令 Get-MgBetaServicePrincipalClaimMappingPolicy: https://learn.microsoft.com/en-us/graph/api/serviceprincipal-list-claimsmappingpolicies?view=graph-rest-beta&tabs=powershell 但它总是返回空值,即使我可以看到属性是在 Azure 门户中配置的。 门户

我正在使用图形范围:Application.Read.All 和 Policy.Read.All

知道如何读取此配置吗?

问候

azure powershell microsoft-graph-api microsoft-entra-id
1个回答
0
投票

目前,无法通过 PowerShell 或 Graph API 从 SAML Entra 应用程序配置中检索“属性和声明”。目前唯一的方法是通过 Azure 门户。

我有一个企业应用程序,其“属性和声明”值如下:

enter image description here

当我尝试运行与您相同的 PowerShell 命令时,它将给出 null,如下所示:

Get-MgServicePrincipalClaimMappingPolicy -ServicePrincipalId <sp_id>

回复:

enter image description here

即使 Graph API 查询结果也为 null 响应,因为没有分配给服务主体的声明映射策略:

GET https://graph.microsoft.com/v1.0/servicePrincipals/sp_Id/claimsMappingPolicies

回复:

enter image description here

要通过 PowerShell 创建声明映射策略,您可以参考此 MS 文档 并将它们分配给服务主体。

参考:

使用 PowerShell 从 SAML Entra 应用程序配置中读取“属性和声明” - Microsoft 问答,作者:Raja Pothuraju

© www.soinside.com 2019 - 2024. All rights reserved.