Wednesday, October 26, 2011

Clone NTFS Permissions Fast with PowerShell

Need to clone NFTS permissions between two folders or files? The Get-Acl & Set-Acl commandlets provide this capability when used in conjunction with each other. With the one-liner below, you can transfer complex permissions from source to destination in seconds.
Set-Acl -path "\\fileserver.asia.ad.local\dept\target_directory" -aclObject (Get-Acl -path "\\fileserver.europe.ad.local\dept\source_directory")