[BUG] Set-PnPFolderPermission: Object reference not set to an instance of an object on server. The object is associated with property ListItemAllFields. #4148
Replies: 3 comments
-
@YuriySamorodov - Your When I run the command with your values, I can reproduce the error. However, if you have created a folder yourself called "Shared Documents", then your I have no issue otherwise when trying with |
Beta Was this translation helpful? Give feedback.
-
Hi, @veronicageek . Shared Documents is the default Documents library. |
Beta Was this translation helpful? Give feedback.
-
I submitted a PR at #4157 to change the error message. Set-PnPListPermission is probably what you should use to set permissions at list/library level. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Reporting an Issue or Missing Feature
I am reporting a bug
Expected behavior
Set-PnPFolderPermission -List Documents -User user@outlook.com -Identity $folder -AddRole Contribute
should add permission on a folder.Actual behavior
Getting

Set-PnPFolderPermission: Object reference not set to an instance of an object on server. The object is associated with property ListItemAllFields.
error when trying to execute the commandSet-PnPFolderPermission -List Documents -User user@outlook.com -Identity $folder -AddRole Contribute
Related bugs: #4143
Steps to reproduce behavior
What is the version of the Cmdlet module you are running?
PnP,PowerShell 2.5.39
Which operating system/environment are you running PnP PowerShell on?
Beta Was this translation helpful? Give feedback.
All reactions