Hello,
I have an issue where I'm trying to remove an orphaned user account in Office 365. The account still exists in Office 365 and shows up in the global address list, however it's been deleted on-prem and sync is working fine. So I've found articles saying to manually wipe it on Office 365 using the following command. However, I keep getting an Access Denied error every time. I'm using elevated powershell, I'm a global admin in office 365 and I don't think it's a UPN issue because I'm able to use the Get-MsolUser and find the account. Any other ideas? Thanks!
Remove-MsolUser -UserPrincipalName account_name
Remove-MsolUser : Access Denied. You do not have permissions to call this cmdlet.
A "Get-MsolUser -UserPrincipalName account_name" returns the user account just fine.