fixed acl issue

This commit is contained in:
Karl-Wilfried Zimmer 2024-07-14 23:50:35 +02:00
parent eeb8abbd45
commit 85eeec864c

View File

@ -65,15 +65,16 @@ if($PSBoundParameters.ContainsKey("ProjectName")){
$FolderACL= Get-Acl -Path $folder $FolderACL= Get-Acl -Path $folder
$rid = $ReadTarget.Name $rid = $ReadTarget.SID
$wid = $WriteTarget.Name $wid = $WriteTarget.SID
$fsrr = "ReadAndExecute" $fsrr = "ReadAndExecute"
$fsrw = "Write" $fsrw = "Write"
$type = "Allow" $type = "Allow"
$fileSystemAccessRuleR = New-Object System.Security.AccessControl.FileSystemAccessRule($rid,$fsrr,"ContainerInherit, ObjectInherit",,$type)
$fileSystemAccessRuleW = New-Object System.Security.AccessControl.FileSystemAccessRule($Wid,$fsrw,"ContainerInherit, ObjectInherit",,$type) $fileSystemAccessRuleR = New-Object System.Security.AccessControl.FileSystemAccessRule($rid.Name,$fsrr,"ContainerInherit, ObjectInherit","None",$type)
$fileSystemAccessRuleWR = New-Object System.Security.AccessControl.FileSystemAccessRule($rid,$fsrr,"ContainerInherit, ObjectInherit",,$type) $fileSystemAccessRuleW = New-Object System.Security.AccessControl.FileSystemAccessRule($wid.Name,$fsrw,"ContainerInherit, ObjectInherit","None",$type)
$fileSystemAccessRuleWR = New-Object System.Security.AccessControl.FileSystemAccessRule($wid.Name,$fsrr,"ContainerInherit, ObjectInherit","None",$type)
$FolderACL.SetAccessRule($fileSystemAccessRuleR) $FolderACL.SetAccessRule($fileSystemAccessRuleR)
$FolderACL.SetAccessRule($fileSystemAccessRuleW) $FolderACL.SetAccessRule($fileSystemAccessRuleW)