Hello,
I have hundreds of users that I need to delete in Office 365 and I'm trying to this by importing a CSV into Poweshell. I've already installed the proper components here and here and I've tried following a few different guides from Stackoverflow, Microsoft Technet Blogs, and even a nice script someone had already created.
For the most part everything works great. However, I'm getting stuck on an error after running the command:
Get-MsolUser -UserPrincipalName $fila.$sColumnName | Remove-MsolUser -Force -RemoveFromRecycleBin
Remove-MsolUser : User Not Found in the Microsoft Online directory Deleted Users container.
If I go the Office 365 web GUI and manually delete an active user and just run the command "Remove-MsolUser -Force -RemoveFromRecycleBin" it succeeds.
For some reason this command doesn't delete "Active" users. Only "Deleted" users. I feel like I'm missing something but every guide I come across says to do the above commands to delete users.
I have the bulk import part working. It's reading my CSV file just fine. It just fails with the above error. I've read that this error can occur if the user performing the delete doesn't have "Global Admin" but I have proper permissions.
Thank you.