Fix permissions on redirected folders when Grant the user exclusive rights has been set

Do you have redirected folders setup on your network and/or you have inherited a network that does and you have found that the “Grant the user exclusive rights” is set meaning you have no access to users folders?

Then search no more for the solution, simply run this script against the folders and gain access easily.

# CACLS rights are usually
# F = FullControl
# C = Change
# R = Readonly
# W = Write

$StartingDir= "D:\ServerFolders\Folder Redirection"



$Verify=Read-Host `n "You are about to change permissions on all" `
"files starting at"$StartingDir.ToUpper() `n "for security"`
"principal"$Principal.ToUpper() `
"with new right of"$Permission.ToUpper()"."`n `
"Do you want to continue? [Y,N]"

if ($Verify -eq "Y") {

foreach ($file in $(Get-ChildItem $StartingDir -recurse)) {
#display filename and old permissions
write-Host -foregroundcolor Yellow $file.FullName
#uncomment if you want to see old permissions
#CACLS $file.FullName

#ADD new permission with CACLS
CACLS $file.FullName /E /P "${Principal}:${Permission}" >$NULL

#display new permissions
Write-Host -foregroundcolor Green "New Permissions"
CACLS $file.FullName

If you found this article helpful, would you consider buying me a Coffee?