Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OmerMicrosoft/d78616284fbae6e58aa762ddf10a1ebc to your computer and use it in GitHub Desktop.
Save OmerMicrosoft/d78616284fbae6e58aa762ddf10a1ebc to your computer and use it in GitHub Desktop.
Assign the 'TenantCreator' role to a selected user for WVD (Windows Virtual Desktop)
$WVDApplication = Get-AzureADServicePrincipal -Filter "displayName eq 'Windows Virtual Desktop'"
$ApplicationRole = $WVDApplication.AppRoles | Where-Object { $_.DisplayName -eq 'TenantCreator'}
$UserAccount = Get-AzureADUser -ObjectId $AzureAccount.Id
New-AzureADUserAppRoleAssignment -ObjectId $UserAccount.ObjectId -PrincipalId $UserAccount.ObjectId -ResourceId $WVDApplication.ObjectId -Id $ApplicationRole.Id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment