Cloning NTFS Permissions

by Dec 17, 2014

All PowerShell Versions

Here is some simple code that reads the NTFS permissions from one folder and applies the exact same settings to another. Note that both folders must exist:

$FolderToCopyFrom = 'C:\folder1'
$FolderToCopyTo = 'C:\folder2'

$securityDescriptor = Get-Acl -Path $FolderToCopyFrom
Set-Acl -Path $FolderToCopyTo -AclObject $securityDescriptor 

Cloning a security descriptor may require Administrator privileges. Note that all security rules on the second folder are overwritten by the security information taken from the first folder.

Twitter This Tip! ReTweet this Tip!