Forum Discussion
MustangProgrammer
Sep 29, 2025Copper Contributor
Creating Claims Mapping Policy in Entra ID
I am attempting to create a Claims Mapping Policy using PowerShell, Entra ID and Microsoft Graph via a script or a PowerShell Window, In neither case, I was able to do it. The script is: # Defin...
LainRobertson
Sep 30, 2025Silver Contributor
The format of your claim is incorrect, which based on version 2.30.0 of the commandlet does indeed show up in the error:
The specific issue is you haven't provided the key-value pair correctly, where it is supposed to be in the format of "ID":"attributeName". Here's the correct format:
$params = @{
definition = @(
'{"ClaimsMappingPolicy":{"Version":1,"IncludeBasicClaimSet":"false","ClaimsSchema":[{"Source":"user","ID":"onpremisesssamaccountname","SamlClaimType": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"}]}}'
)
displayName = "ClaimTest"
}
Which is then accepted by Graph, as demonstrated below:
Cheers,
Lain