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