Microsoft Entra ID

Users Revoke Access

In brief

How to revoke all access for a user in Microsoft Entra ID

Documentation change

Prerequisites

The PowerShell steps in this article require the following:

Sign in with an account that has the appropriate roles. Different steps require different roles:

```PowerShell
Install-Module Microsoft.Graph.Users
Install-Module Microsoft.Graph.Users.Actions
Install-Module Microsoft.Graph.Identity.DirectoryManagement
```

The PowerShell steps in this article also require the Microsoft Graph PowerShell SDK. Install the required modules:

Install-Module Microsoft.Graph.Users
Install-Module Microsoft.Graph.Users.Actions
Install-Module Microsoft.Graph.Identity.DirectoryManagement
```PowerShell
Connect-MgGraph -Scopes "User.ReadWrite.All","Directory.AccessAsUser.All"
```

Connect to Microsoft Graph with the required scopes:

Connect-MgGraph -Scopes "User.ReadWrite.All","Directory.AccessAsUser.All"

Access tokens and refresh tokens

Microsoft Entra environment

As an administrator in Microsoft Entra ID, open PowerShell, connect to Microsoft Graph with the required scopes (see Prerequisites), and take the following actions:

For an individual user, you can use the Microsoft Entra admin center to block new sign-ins and revoke refresh tokens.

  1. Sign in to the Microsoft Entra admin center with an account that has the appropriate role. For more information, see Prerequisites.

  2. Browse to Entra ID > Users > All users, and then select the user.

  3. Under Account status, select Edit.

  4. In Properties, clear Account enabled, and then select Save.

  5. On the user Overview page, select Revoke sessions.

For repeatable response actions, bulk response, or disabling the user's registered devices, open PowerShell, connect to Microsoft Graph with the required scopes (see Prerequisites), and take the following actions:

  1. Disable the user in Microsoft Entra ID. Refer to Update-MgUser.