Hi @Diana C ,
Thanks for reaching out.
You need to first connect to Azure AD using Connect-AzureAD.
then to remove the permission assigned to user using
Remove-AzureADOAuth2PermissionGrant -objectId <objectId>
To get the objectId of the user, run Get-AzureADOAuth2PermissionGrant powerShell command to retrieve objectId, resourceID and scope assigned.
Here resourceId is the service Principal ID which you can match with the permission you want to remove.
Match the service Principal Id with the resource Id and copy the corresponding objectId from the above.
You can then remove the permissions using
Remove-AzureADOAuth2PermissionGrant -ObjectId SLC0E57-xxxxxx-xxxxxx
which will remove the permission.
Hope this will help.
Thanks,
Shweta
Please remember to "Accept Answer" if answer helped you.