From b0175da17abe57ed6f10dd13959096e2f1ce0d35 Mon Sep 17 00:00:00 2001 From: Karl-Wilfried Zimmer Date: Mon, 15 Jul 2024 20:36:39 +0200 Subject: [PATCH] added rights to create files and directories to write prem --- NewProject2.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NewProject2.ps1 b/NewProject2.ps1 index f6c30cd..ade5a85 100644 --- a/NewProject2.ps1 +++ b/NewProject2.ps1 @@ -69,16 +69,22 @@ if($PSBoundParameters.ContainsKey("ProjectName")){ $wid = $WriteTarget.SID $fsrr = "ReadAndExecute" $fsrw = "Write" + $fsrad = "CreateDirectories" + $fsraf = "CreateFiles " $type = "Allow" $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) $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($fileSystemAccessRuleW) $FolderACL.SetAccessRule($fileSystemAccessRuleWR) + $FolderACL.SetAccessRule($fileSystemAccessRuleWAF) + $FolderACL.SetAccessRule($fileSystemAccessRuleWAD) Set-Acl -Path $folder.FullName -AclObject $FolderACL