Jump to content

Recommended Posts

Posted

Hello, I am trying to completely delete some users, I have made a script to delete their AD account, OneDrive, Sharepoint Info etc and there's one last bit where the SPO User exisits but will not remove. The account I am using is Glabal Admin and SharePoint admin.  Can anyone advise how I remove this last bit?

 

>$UserPrincipalName = "[email protected]"

 

>Get-SpoUser -Site "https://school.sharepoint.com" -LoginName $UserPrincipalName | fl *


DisplayName        : John Brown
LoginName          : [email protected]
IsSiteAdmin        : False
IsGroup            : False
Groups             : {}
UserType           : Member

 

>Remove-SPOUser -Site "https://school.sharepoint.com" -LoginName $UserPrincipalName
Remove-SPOUser: Attempted to perform an unauthorized operation.

 

Thanks

Posted

Does -Verbose show any more info and does it work on any groups/users such as a test group

Could also be permissions related "You must be at least a SharePoint Online administrator and be a site collection administrator"

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...