[BUG] Set-PnPListItemPermission fails when AAD user is disabled #2400
Unanswered
jeremyhagan
asked this question in
General
Replies: 2 comments
-
I'm afraid that this is the SharePoint behavior. Can you replicate it in the user interface? |
Beta Was this translation helpful? Give feedback.
0 replies
-
@jeremyhagan - Its not a bug but standard SharePoint behavior , moving this to discussion forum. |
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
When using Set-PnPListItemPermission to add permissions to a document library folder for a licensed AAD user that is sign in disabled (or very recently enabled) the cmdlet fails and throw an error "The specified user [email protected] could not be found"
Please note that the user must not be already in the list as shown by Get-PnPUser for this failure to occur.
Expected behavior
The user is a licensed SharePoint user and should be added to the permissions for the list item.
Actual behavior
Error is thrown
Steps to reproduce behavior
Create and license a new AAD user with SharePoint plan 2 and leave it as sign in disabled. Wait 15 minutes.
Add permissions
Set-PnPListItemPermission -List $DocLibrary -Identity $FolderId -User [email protected] -AddRole "Read" -Connection $SPConnection
Error is thrown
Enable the user in ADD and immediately rerun the command
Error is thrown
Wait 5 minutes then rerun the command
Command is successful
Disable the user in AAD
Remove the user from the site (Remove-PnPUser)
Wait 5 minutes
Rerun the command
Error is thrown
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