Forum Discussion
Sagar_Lad
May 15, 2020Brass Contributor
Change User Assignment required to Yes using powershell/azure CLI for enterprise application
Hi Team, I would like to enable User Assignment required to Yes using powershell/azure CLI for enterprise application. Could you suggest how can I enable it? Thank You.
- May 16, 2020You can use PowerShell to set the appRoleAssignmentRequired property on the service principal.
Reference: https://docs.microsoft.com/en-us/azure/active-directory/manage-apps/what-is-access-management#requiring-user-assignment-for-an-app
#Get current value first
Get-AzureADServicePrincipal -Filter "displayname eq 'My Test App'" | select displayname, AppRoleAssignmentRequired
#Change value to yes
Get-AzureADServicePrincipal -Filter "displayname eq 'My Test App'" | set-AzureADServicePrincipal -AppRoleAssignmentRequired $true
#Confirm the value changed
Get-AzureADServicePrincipal -Filter "displayname eq 'My Test App'" | select displayname, AppRoleAssignmentRequired
If this helped you please mark as best answer. thank you.
Joe Stocker
May 16, 2020Bronze Contributor
You can use PowerShell to set the appRoleAssignmentRequired property on the service principal.
Reference: https://docs.microsoft.com/en-us/azure/active-directory/manage-apps/what-is-access-management#requiring-user-assignment-for-an-app
#Get current value first
Get-AzureADServicePrincipal -Filter "displayname eq 'My Test App'" | select displayname, AppRoleAssignmentRequired
#Change value to yes
Get-AzureADServicePrincipal -Filter "displayname eq 'My Test App'" | set-AzureADServicePrincipal -AppRoleAssignmentRequired $true
#Confirm the value changed
Get-AzureADServicePrincipal -Filter "displayname eq 'My Test App'" | select displayname, AppRoleAssignmentRequired
If this helped you please mark as best answer. thank you.
Reference: https://docs.microsoft.com/en-us/azure/active-directory/manage-apps/what-is-access-management#requiring-user-assignment-for-an-app
#Get current value first
Get-AzureADServicePrincipal -Filter "displayname eq 'My Test App'" | select displayname, AppRoleAssignmentRequired
#Change value to yes
Get-AzureADServicePrincipal -Filter "displayname eq 'My Test App'" | set-AzureADServicePrincipal -AppRoleAssignmentRequired $true
#Confirm the value changed
Get-AzureADServicePrincipal -Filter "displayname eq 'My Test App'" | select displayname, AppRoleAssignmentRequired
If this helped you please mark as best answer. thank you.
Sagar_Lad
May 16, 2020Brass Contributor