Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

Set-ACL on remote share breaks inheritance

$
0
0

I am trying to change permissions on a folder on a remote server share and it seems to break the inheritance already placed on the folder. This seems to only happen at the root of the share and not a subfolder of a share. Is there a workaround or will I have to change the perm using the adminshare? Below is my code:

$colRights = [System.Security.AccessControl.FileSystemRights]"Read, Write"
$InheritanceFlag = [System.Security.AccessControl.InheritanceFlags]::None
$PropagationFlag = [System.Security.AccessControl.PropagationFlags]::None
$objType =[System.Security.AccessControl.AccessControlType]::Allow
$objUser = New-Object System.Security.Principal.NTAccount("mntech\caseytest")
$objACE = New-Object System.Security.AccessControl.FileSystemAccessRule($objUser, $colRights, $InheritanceFlag, $PropagationFlag, $objType)
$objACL = Get-ACL "\\fileserver\TestShare\folder"
$objACL.AddAccessRule($objACE)
Set-ACL "\\fileserver\TestShare\folder" $objACL


Viewing all articles
Browse latest Browse all 2562

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>