Articles about European Sharepoint Hosting Service
SharePoint 2013 Hosting – HostForLIFE :: Create A Folder And Set Unique Permission Using PnP PowerShell
In this blog, we are going to create a folder in Document Library and set unique permission to a user for this created folder using PnP Power Shell. The Administrator can set the required permission to a user depending on the organizational needs. Here we can use this script to set permission to a particular user. Please follow the below steps.
Step 1
Run the ISE in administrative mode. Then declare variables named “sUrl”, “user”, “Folder Name”, and “SiteRelativeURL” to store the respective values.
Step 2
Connect to PnP online and get the credentials.
Connect-PnPOnline-Url$sUrl-Credentials (Get-Credential)
Step 3
To create the folder in the document, use the PnP commands as shown in the code.
Add-PnPFolder-Name$FolderName-Folder$SiteRelativeURL-ErrorActionStop
Step 4
Copy and run the below codes to create a folder in Document and to set unique permission in the folder for a user.
After running the script,
Print article | This entry was posted by Peter on April 5, 2021 at 3:42 am, and is filed under European SharePoint 2013 Hosting. Follow any responses to this post through RSS 2.0. Both comments and pings are currently closed. |