Powershell: Recovering Deleted Users in Microsoft 365
Intro
Prerequisites
Install-Module Microsoft.Graph -Scope CurrentUserConnect-MgGraph -Scopes "User.ReadWrite.All", "Directory.ReadWrite.All"View Deleted Users
Get-MgUserDeletedRestore a Deleted User
Restore All Deleted Users (Use with Caution)
Permanently Delete a Soft-Deleted User (Hard Delete)
Summary
REFERENCES
PreviousPowershell: Deleting Users in Microsoft 365NextEnable Archive Policy & Assign Retention Tag for a User in Microsoft 365
Last updated