Bulk Folder Permissions Changes


How to  use:

  1. Copy attached BulkSet-NTFSPermissions.ps1 script to C:\Temp
  2. Open Powershell
  3. Run this command:List Folders to File
    Get-ChildItem REPLACEWITHPATH | Where-Object {$_.psIsContainer} | Select fullname | Out-File c:\temp\FolderPermissions.txt
  4. Open the c:\temp\FolderPermissions.txt File
  5. Remove the First 3 lines.  The first line is whitespace, the second says Full Name, the third is ----.
  6. Open Powershell and navigate to c:\temp
  7. Run the following command with the persons user id.
    .\BulkSet-NTFSPermissions.ps1 -FolderListFile c:\temp\FolderPermissions.txt -SecIdentity "Domain\Group or User" -AccessRights "FullControl" -AccessControlType "Allow"

Below is original Syntax of Command

.\BulkSet-NTFSPermissions.ps1 -FolderListFile x:\xxxx\xxxx.txt -SecIdentity "Domain\Group or User" -AccessRights "FullControl" -AccessControlType "Allow"

Here is the options.

  • FolderListFile: a flat text file containing the list of path that need to apply the NTFS permission. It needs to list one folder per line. the path can be a absolute local path such as C:\temp or a UNC path such as \\computer\C$\temp.
  • SecIdentity: The security identity (such as a user account or a security group) the permission is applied for.
  • AccessRights: type of access rights, such as FullControl, Read, ReadAndExecute, Modify, etc..
  • AccessControlType: Allow or Deny