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
$rid = $ReadTarget.Name
$wid = $WriteTarget.Name
$rid = $ReadTarget.SID
$wid = $WriteTarget.SID
$fsrr = "ReadAndExecute"
$fsrw = "Write"
$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)
$fileSystemAccessRuleWR = New-Object System.Security.AccessControl.FileSystemAccessRule($rid,$fsrr,"ContainerInherit, ObjectInherit",,$type)
$fileSystemAccessRuleR = New-Object System.Security.AccessControl.FileSystemAccessRule($rid.Name,$fsrr,"ContainerInherit, ObjectInherit","None",$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($fileSystemAccessRuleW)