added rights to create files and directories to write prem

This commit is contained in:
Karl-Wilfried Zimmer 2024-07-15 20:36:39 +02:00
parent 1832cbae33
commit b0175da17a

View File

@ -69,16 +69,22 @@ if($PSBoundParameters.ContainsKey("ProjectName")){
$wid = $WriteTarget.SID $wid = $WriteTarget.SID
$fsrr = "ReadAndExecute" $fsrr = "ReadAndExecute"
$fsrw = "Write" $fsrw = "Write"
$fsrad = "CreateDirectories"
$fsraf = "CreateFiles "
$type = "Allow" $type = "Allow"
$fileSystemAccessRuleR = New-Object System.Security.AccessControl.FileSystemAccessRule($rid,$fsrr,"ContainerInherit, ObjectInherit","None",$type) $fileSystemAccessRuleR = New-Object System.Security.AccessControl.FileSystemAccessRule($rid,$fsrr,"ContainerInherit, ObjectInherit","None",$type)
$fileSystemAccessRuleW = New-Object System.Security.AccessControl.FileSystemAccessRule($wid,$fsrw,"ContainerInherit, ObjectInherit","None",$type) $fileSystemAccessRuleW = New-Object System.Security.AccessControl.FileSystemAccessRule($wid,$fsrw,"ContainerInherit, ObjectInherit","None",$type)
$fileSystemAccessRuleWR = New-Object System.Security.AccessControl.FileSystemAccessRule($wid,$fsrr,"ContainerInherit, ObjectInherit","None",$type) $fileSystemAccessRuleWR = New-Object System.Security.AccessControl.FileSystemAccessRule($wid,$fsrr,"ContainerInherit, ObjectInherit","None",$type)
$fileSystemAccessRuleWAF = New-Object System.Security.AccessControl.FileSystemAccessRule($wid,$fsraf,"ContainerInherit, ObjectInherit","Synchronize",$type)
$fileSystemAccessRuleWAD = New-Object System.Security.AccessControl.FileSystemAccessRule($wid,$fsrad,"ContainerInherit, ObjectInherit","Synchronize",$type)
$FolderACL.SetAccessRule($fileSystemAccessRuleR) $FolderACL.SetAccessRule($fileSystemAccessRuleR)
$FolderACL.SetAccessRule($fileSystemAccessRuleW) $FolderACL.SetAccessRule($fileSystemAccessRuleW)
$FolderACL.SetAccessRule($fileSystemAccessRuleWR) $FolderACL.SetAccessRule($fileSystemAccessRuleWR)
$FolderACL.SetAccessRule($fileSystemAccessRuleWAF)
$FolderACL.SetAccessRule($fileSystemAccessRuleWAD)
Set-Acl -Path $folder.FullName -AclObject $FolderACL Set-Acl -Path $folder.FullName -AclObject $FolderACL