Created
September 11, 2019 23:20
-
-
Save cbrherms/194d96ab57ab97284cb10e8a5917b917 to your computer and use it in GitHub Desktop.
Undelete all unsynced (deleted) 365 users
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Users = Get-MsolUser -All -ReturnDeletedUsers ; | |
$Users | ForEach-Object{Restore-MsolUser -ObjectId $_.ObjectId} ; | |
$Users | ForEach-Object{Set-MsolUser -ObjectId $_.ObjectId -ImmutableId ""} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment