A customer has the follow problem. A employee has left the company and the account is removed. That`s fine no problem. the only problem is the user was a site admin. Now the user is removed and we found out that we cannot remove the user with powershell only by hand and the user was also owner of all Onedrive sites :-( (not good I know, I just fined this out myself)
How can we remove this "unknow" user from existing sites?
$OneDriveSiteURL = "https://SITE-my.sharepoint.com/personal/user_com"
$UserAccount = "unknowuser@domain.com"
$Site = Get-SPOSite $OneDriveSiteURL
Set-SPOUser -Site $Site -LoginName $UserAccount -IsSiteCollectionAdmin $False
error message
Set-SPOUser : The user does not exist or is not unique.