Forum Discussion

MustangProgrammer's avatar
MustangProgrammer
Copper Contributor
Sep 29, 2025
Solved

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's avatar
    Sep 30, 2025

    Hi MustangProgrammer​,

     

    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

Resources