Replies: 2 comments 1 reply
-
On what kind of sites does the command fail? Are those special sites or random team / communication sites? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Looks like some configuration issue which is preventing you from removing the user. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Reporting an Issue or Missing Feature
For a few, seemingly random sites, the Remove-PnPUser cmdlet reports ServerUnauthorizedAccessException. I am connecting with clientid + secret, went through about 2000 sites, about 15 throws this error. The command works on rest of the sites fine, the user is removed.
Expected behavior
The command should remove the given user.
Actual behavior
for sime sites, the following error is reported:
Remove-PnPUser : Attempted to perform an unauthorized operation.
At line:27 char:1
Steps to reproduce behavior
Please include complete script or code samples in-line or linked from gists
'' Connect-PnPOnline -Url $_ -ClientSecret $clientsecret -ClientId $clientid -WarningAction Ignore
'' Remove-PnPUser -Identity $usertoremove -Confirm:$false
What is the version of the Cmdlet module you are running?
1.11.0
Which operating system/environment are you running PnP PowerShell on?
Beta Was this translation helpful? Give feedback.
All reactions