How to Restore a Deleted User in Office 365

Recover deleted user accounts and their data in Office 365

5 min readUpdated January 2025

When a user is deleted in Office 365, their account can be restored within 30 days before permanent deletion. Restoring a deleted user recovers their email, OneDrive files, and other associated data. This guide explains how to restore a user via the Microsoft 365 Admin Center and PowerShell.

Requirements

  • Admin access to the Microsoft 365 Admin Center or Exchange Online PowerShell.
  • The user must have been deleted within the last 30 days to be recoverable.

Method 1: Restore a Deleted User via Microsoft 365 Admin Center

Step 1: Log into the Admin Center

  1. Open a browser and go to https://admin.microsoft.com.
  2. Sign in with your administrator credentials.

Step 2: Navigate to Deleted Users

  1. In the left-hand menu, click Users > Deleted users.
  2. Locate the user you want to restore.

Step 3: Restore the User Account

  1. Click on the user’s name to open their profile.
  2. Click Restore user.
  3. If prompted, assign a new password or reset the existing one.

Step 4: Assign Licenses (If Required)

  • If the user was assigned a license before deletion, Office 365 will attempt to restore it.
  • If no licenses are available, you must purchase or reassign one.

📌 Note: It may take a few minutes for the user’s data and access to be fully restored.


Method 2: Restore a Deleted User via PowerShell

For larger organizations, PowerShell is a faster way to restore users in bulk.

Step 1: Connect to Microsoft Entra ID PowerShell

  1. Open PowerShell on your computer.
  2. Run the following command to connect to Microsoft Entra ID (Azure AD):powershellCopyEditConnect-MgGraph -Scopes "User.ReadWrite.All"
  3. Authenticate using your admin credentials when prompted.

Step 2: List Recently Deleted Users

To see all deleted users that are still recoverable, run:

Get-MgDirectoryDeletedUser

Step 3: Restore a Specific User

To restore a specific user, run:

Restore-MgDirectoryDeletedUser -UserId "[email protected]"

Step 4: Verify the Restoration

After restoring, confirm the user is active by running:

Get-MgUser -UserId "[email protected]"

What Happens After Restoring a User?

  • The user will regain access to their email, OneDrive files, and assigned licenses.
  • Group memberships and permissions may need to be reconfigured.
  • If the user’s data was transferred to another user before deletion, it will not be automatically restored.

How to Permanently Delete a User (Before 30 Days Expire)

If you want to permanently delete a user before the 30-day retention period expires:

Using Admin Center:

  1. Go to Admin Center > Users > Deleted users.
  2. Select the user and click Permanently delete.

Using PowerShell:

Run the following command:

Remove-MgDirectoryDeletedUser -UserId "[email protected]"

📌 Warning: This action is irreversible!


Best Practices

Monitor Deleted Users – Regularly review deleted users to ensure no accidental removals.
Use Role-Based Access Control – Limit who can delete users to prevent accidental data loss.
Back Up User Data – Consider using third-party backup tools for extra data protection.

Frequently Asked Questions

Find answers to common questions

If you are unable to assign a license to a restored user, verify your available licenses in the Microsoft 365 Admin Center. If there are no available licenses, you will need to either purchase more or reassign an existing license from another user. Keep in mind that the restoration process may also take a few minutes for full data access to be available.

Need Professional Help?

Our team of experts can help you implement and configure these solutions for your organization.