Im trying to add additional claim mapping to an app registration, Ive created in my tenant.
$app = Get-AzureADApplication -ObjectId <obj-id>
$policy = New-Object Microsoft.Open.AzureAD.Model.ClaimsMappingPolicy
$policy.InputClaims = @(
(New-Object Microsoft.Open.AzureAD.Model.InputClaim).Type("email")
)
$policy.OutputClaims = @(
(New-Object Microsoft.Open.AzureAD.Model.OutputClaim).Type("t24user")
)
$policy.ClaimMappings = @(
(New-Object Microsoft.Open.AzureAD.Model.ClaimMapping).InputClaimType("email").OutputClaimType("t24user").TransformationMethod("ExtractPrefixFromEmail")
)
Im getting the following error when I run this on line 2
$policy = New-Object Microsoft.Open.AzureAD.Model.ClaimsMappingPolicy
At line:1 char:11
+ $policy = New-Object -TypeName Microsoft.Open.AzureAD.Model.ClaimsMap ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidType: (:) [New-Object], PSArgumentException
+ FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand
I tried to re-install AzureAD module and also tried with installing AzureADPreivew Module also. But it was not helping. Appreciate help here.