You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of our goals is to assign MS Teams members and members of Azure AD Security Groups to file and folder permissions in SharePoint using Powershell. MS Teams and Azure AD Groups can be added using the UI.
Currently, this does not seem to be working for me. This example using a SharePoint Group works: Set-PnPFolderPermission -List "$library" -Group "Files Visitors" -AddRole "Edit" -Identity "$library/$folder"
But these examples using a MS Team and an Azure AD Group (respectively) do not:
Both the Team in question and the Azure AD Group in question exist and the variables resolve to the correct names. Both the Team and the Azure AD Group can be added and given permissions in the UI. Attempting to add via the example commands above gives an error. Example error:
Set-PnPFolderPermission : Group cannot be found.
At line:1 char:1
+ Set-PnPFolderPermission -List "$library" -Group "AADSG-$($folder)Admi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Set-PnPFolderPermission], PSInvalidOperationException
+ FullyQualifiedErrorId : InvalidOperation,PnP.PowerShell.Commands.Files.SetFolderPermission
I take it only SharePoint Groups are allowed and MS Team and Azure AD Group permissions must be added manually? If there is a good way to accomplish this within a script, I would be pleased to have any hints :)
We have tried with various combinations of $group.ObjectID, etc. to no avail. I appreciate the responses!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
One of our goals is to assign MS Teams members and members of Azure AD Security Groups to file and folder permissions in SharePoint using Powershell. MS Teams and Azure AD Groups can be added using the UI.
Currently, this does not seem to be working for me. This example using a SharePoint Group works:
Set-PnPFolderPermission -List "$library" -Group "Files Visitors" -AddRole "Edit" -Identity "$library/$folder"
But these examples using a MS Team and an Azure AD Group (respectively) do not:
Both the Team in question and the Azure AD Group in question exist and the variables resolve to the correct names. Both the Team and the Azure AD Group can be added and given permissions in the UI. Attempting to add via the example commands above gives an error. Example error:
I take it only SharePoint Groups are allowed and MS Team and Azure AD Group permissions must be added manually? If there is a good way to accomplish this within a script, I would be pleased to have any hints :)
We have tried with various combinations of $group.ObjectID, etc. to no avail. I appreciate the responses!
Beta Was this translation helpful? Give feedback.
All reactions