0

I am trying to remove a cached user account added in more than 18000 sites. for that I have been trying below PNP script:

$displayName = "DisplayNameOfAccountThatNeedTobeRemoved" Get-PnPTenantSite | ForEach-Object { $site = $_ Write-Host "Processing $($site.Url)..." Connect-PnPOnline $site.Url -Credentials $creds Get-PnPUser | ? Title -like $displayName | Remove-PnPSiteCollectionAdmin } 

But it is giving me an error "Access denied. You do not have permission to perform this action or access this resource."

I have also tried Remove-SPOUSer cmdlet too but it is giving me same error message.

I cannot add my account as a site collection admin on all the sites due to compliance and efficiency purposes. I do have SharePoint admin rights though.

1 Answer 1

0

By default, user information list is only visible and accessible by each site collection administrators.

I don't think it's possible to remove a user account from user information list without being a site collection administrator.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.