locked
reset permission inheritance RRS feed

  • Question

  • We have a document library with folders, sub folders at multiple levels. We were using unique permissions on all these folders till date  and now we  want to inherit permissions from parent library. Is there a way to apply/reset permissions on all the folders so that we can have same permission as parent folder everywhere or we have to do it manually .


    Amrita Talreja
    Wednesday, September 21, 2011 11:27 PM

All replies

  • Amrita,

    One option is to force a permissions set on a folder and its children using Powershell.  I do this often to repair item level permissions that have been broken, or just gotten out of control. I referenced this entry by Niklas Goude link to build by scripts. I do feel it will serve you well.

    Let me restate:

    A common Admin task is Setting permissions on folders for new Users or Groups. doing this manually can be pretty boring and timeconsuming. This script automates these steps through PowerShell.

    The parameters that I’ve added to the script are:

     

    • -Path Folder to Create (Required)
    • -User User who should have access (Required)
    • -Permission Specify Permission for User, Default set to Modify (Optional)
    • -help Prints the HelpFile (Optional)

    The script sets the folderpermissions for a User or a group on a folder and if the folder doesn’t exist, it creates the folder and adds the specified permissions.

    Running the Script on one folder gives the user or group permissions on the folder and on child folders. If you run the script recurse, it will break the inheritance for the specified User/Group and set the permissions specified on each folder.

    Here are 2 examples on running the script.

    
    ./SetFolderPermission.ps1 -path C:\User -Access APA\MyGroup -Permission Write
    
    Get-ChildItem -path C:\User -recurse |
    Where { $_.Attributes -match "d"} |
    ForEach {
    ./SetFolderPermission.ps1 -path $_.Fullname -Access APA\MyGroup -Permission Read
    }
    
    

    If you want to display the HelpText simply type:

    
    ./SetFolderPermission.ps1 -help
    
    

    Here’s a link to the script


    Thursday, September 22, 2011 3:07 AM
  • I have seen this script but was not sure if it will work on sharepoint ? Have you set permission on SP sites using this script?


    Amrita Talreja
    Thursday, September 22, 2011 1:12 PM
  • this script does not work for sharepoint folders even if we access the folders using UNC path


    Amrita Talreja
    Thursday, September 22, 2011 1:33 PM