How to permanently delete user account from deleted users without waiting 30 days in Office 365?

Have you encounter below errors after you have been deleted user account and recreated with the same UserPrincipalName in your office 365?
  • DirSync reports: Unable to restore user from a deleted state because of following error(s): Value 'user@yourdomain.com' for property 'UserPrincipalName' conflicts with another object in the directory.Value ‘user@yourdomain.com’ for property 'ProxyAddress' conflicts with another object in the directory.
  • Users can sign into https://portal.microsoftonline.com but not able to connect with a desktop client or mobile phone.
  • Multiple users show up in your Global Address List (GAL)
  • In Lync you see a the same user multiple times or you see deleted users
In Office 365 Web Portal Admin Center, there is no option to delete account from deleted users list and have to wait until 30days over to permanently delete those account.

So how? Will you wait to do this?

The answer is NO for me.

OK. Here is some tips to delete user account from deleted users list by using power shell.

For example, I'd like to permanently delete testuser1@ictformyanmar.com from deleted users list.

Below is how I am doing with powershell for this. Please modify in highlighted area as your requirement.

Syntax to see deleted users by listing UserPrincipleName and ObjectID
Get-MsolUser –ReturnDeletedUsers  | select UserPrincipalName, ObjectId

Syntax to permanently delete user by using ObjectID
Remove-MsolUser -RemoveFromRecycleBin –ObjectId ObjectId

I've attached sample photo of permanently delete testuser1@ictformyanmar.com from deleted users list below.







That's it.

May you all be happy.
(Be knowledgeable,pass it on then)

Post a Comment