Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save matejskubic/d7a96b9e0b194d73ad75bac7e7318c2b to your computer and use it in GitHub Desktop.
Save matejskubic/d7a96b9e0b194d73ad75bac7e7318c2b to your computer and use it in GitHub Desktop.
Azure AD - Grant graph and cds
$rra = [System.Collections.Generic.List[Microsoft.Open.AzureAD.Model.RequiredResourceAccess]]::new()
$ra = [Microsoft.Open.AzureAD.Model.RequiredResourceAccess]::new()
$ra.ResourceAppId = "00000003-0000-0000-c000-000000000000" # graph
$ra.ResourceAccess = [Microsoft.Open.AzureAD.Model.ResourceAccess]::new("e1fe6dd8-ba31-4d61-89e7-88639da4683d", "Scope") # User.Read
$rra.Add($ra)
$ra = [Microsoft.Open.AzureAD.Model.RequiredResourceAccess]::new()
$ra.ResourceAppId = "00000007-0000-0000-c000-000000000000" # CDS / Dynamics CRM
$ra.ResourceAccess = [Microsoft.Open.AzureAD.Model.ResourceAccess]::new("78ce3f0f-a1ce-49c2-8cde-64b5c0896db4", "Scope") #user_impersonation
$rra.Add($ra)
Set-AzureADApplication -ObjectId _guid_ -RequiredResourceAccess $rra
@matejskubic
Copy link
Author

Human resources - talent - HR (http://hr.talent.dynamics.com)

$ra = [Microsoft.Open.AzureAD.Model.RequiredResourceAccess]::new()
$ra.ResourceAppId = "f9be0c49-aa22-4ec6-911a-c5da515226ff" # Dynamics 365 for Talent
$ra.ResourceAccess = [Microsoft.Open.AzureAD.Model.ResourceAccess]::new("5762ac01-ace7-4839-a87b-733a3fbf34fd", "Scope") # user_impersonation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment