The Revoke-AzureADUserAllRefreshToken will invalidate applications refresh tokens generated for user which also invalidates tokens issued to session cookies in a browser for the user.
NOTE: So if the user has access or granted access to the application, Azure AD will generate an access token which has
alifetime of one hr.
During this time even if app is deleted ,there are
chances it is still available . Azuread issues a refresh token along
with access token for the resource.
If this is revoked ,the user wont
be able to obtain the token again after the access token expires.
To revoke authorization in between the life span of the access token, please check below commands.
The cmdlet operates by resetting the refreshTokensValidFromDateTime
user property to the current date and time.
Ex: using powershell
PS C:\> Revoke-AzureADUserAllRefreshToken -ObjectId "a1dxxxxx-7xx6-4xxd-axxx-b7xxxxxxxa33"
- This command revokes refresh token of the specified user based on
object id of user.
Same operation using Microsoft graph API
POST https://graph.microsoft.com/{version}/users/{userobject_id}/invalidateAllRefreshToken`
Where as below command(powershell) revokes refresh token for current logged in
user.
Revoke-AzureADSignedInUserAllRefreshToken
As the admin
,you can remove user from the "Users and groups"
section of the enterprise app.

- If the user has consented to the application to access app and if
User assignment required? Is set to no under properties, then the
user can directly go to portal and delete the app.
The app will not be visible for that user when visiting the My apps portal in both the above cases.
Note:When user assignment is not required, unassigned users don't see
the app on their My Apps.
You can use the following script to remove a user and role from an application:
$user = get-azureaduser -ObjectId <objectId>
$spo = Get-AzureADServicePrincipal -ObjectId <objectId>
#Get the ID of role assignment which is assigned to user to unassign
$assignments = Get-AzureADServiceAppRoleAssignment -ObjectId $spo.ObjectId | Where {$_.PrincipalDisplayName -eq $user.DisplayName}
#below cmd will show wha tall is assigned
$assignments | Select *
#In order to remove the Approle assignment check below command.
Remove-AzureADServiceAppRoleAssignment -ObjectId $spo.ObjectId -AppRoleAssignmentId $assignments[assignment #].ObjectId
References:
- Delete oAuth2PermissionGrant (a delegated permission grant) -
Microsoft Graph v1.0 | Microsoft Docs
- Revoke user access in an emergency in Azure Active Directory -
Microsoft Entra | Microsoft Docs