entra id
2 TopicsCreating 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: # Define the Application (Client) ID and Secret $applicationClientId = 'XXXXXXXXXXX' # Application (Client) ID $applicationClientSecret = 'XXXXXXXXXXX' # Application Secret Value $tenantId = 'XXXXXXXXXXXX' # Tenant ID Connect-Entra -TenantId $tenantId -ClientSecretCredential $clientSecretCredential $params = @{ definition = @( '{"ClaimsMappingPolicy":{"Version":1,"IncludeBasicClaimSet":"false","ClaimsSchema":[{"Source":"user","onpremisesssamaccountname":"name","SamlClaimType": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"}]}}' ) displayName = "ClaimTest" } New-MgPolicyClaimMappingPolicy -BodyParameter $params Get-MgPolicyClaimMappingPolicy Disconnect-Entra I keep getting the error: New-MgPolicyClaimMappingPolicy : One or more errors occurred. At C:\Users\eigog\Documents\Poweshell Scripts\test.ps1:24 char:1 + New-MgPolicyClaimMappingPolicy -BodyParameter $params + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [New-MgPolicyClaimMappingPolicy_Create], AggregateException + FullyQualifiedErrorId : System.AggregateException,Microsoft.Graph.PowerShell.Cmdlets.NewMgPolicyClaimMappingPolicy_Create I don't understand, because this was similar to the example they gave here: https://learn.microsoft.com/en-us/entra/identity-platform/claims-customization-powershell And yes, I tried to do it manually in a PowerShell window with my credentials and I tried the beta version as well. The application does have the scope of Policy.ReadWrite.ApplicationConfiguration. I can't seem to see the error. Can anyone see something I'm missing or point me in a direction? Thanks20Views0likes1CommentCan't add device member in Static Security Entra Group with powershell
Hi, With Graph, I want to add some device members in a static security Entra group using it to deploy some certificates with Intune. I do it with following command: New-MgGroupMember -GroupId $groupId -DirectoryObjectId $device.AzureAdDeviceId but I receive this error: New-MgGroupMember : Resource 'df75dfe1-8b5a-4cc6-8f99-17746bb8c07e' does not exist or one of its queried reference-property objects are not present. In C:\Users\E21996\OneDrive - Fondazione Enasarco\Lavoro\!HelpDesk\!Intune\Scripts\Set-Device-Department-Attribute.ps1:57 car:9 + New-MgGroupMember -GroupId $groupId -DirectoryObjectId $devic ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: ({ GroupId = 9fa...ferenceCreate }:<>f__AnonymousType1`2) [New-MgGroupMember_CreateExpanded], Exception + FullyQualifiedErrorId : Request_ResourceNotFound,Microsoft.Graph.PowerShell.Cmdlets.NewMgGroupMember_CreateExpanded I've checked the GroupID and Azure Device ID and are correct. If I try to add a user it works fine, with device I have this error. In the group I can add device member manually from Intune without problems. There is a known issue when add device members to groups in Graph? Can anyone help me to resolve this issue, please?76Views0likes1Comment