From bcf3b89e50f57a36688a47363928371864ac53fb Mon Sep 17 00:00:00 2001 From: Karl-Wilfried Zimmer Date: Mon, 15 Jul 2024 20:58:58 +0200 Subject: [PATCH] changed write over to modify --- NewProject2.ps1 | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/NewProject2.ps1 b/NewProject2.ps1 index 64db0ec..1d2f33b 100644 --- a/NewProject2.ps1 +++ b/NewProject2.ps1 @@ -70,7 +70,7 @@ if($PSBoundParameters.ContainsKey("ProjectName")){ $rid = $ReadTarget.SID $wid = $WriteTarget.SID $fsrr = "ReadAndExecute" - $fsrw = "Write" + $fsrw = "Modify" $fsrad = "CreateDirectories" $fsraf = "CreateFiles " $type = "Allow" @@ -78,9 +78,6 @@ if($PSBoundParameters.ContainsKey("ProjectName")){ $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= Get-Acl -Path $folder $FolderACL.SetAccessRule($fileSystemAccessRuleR) @@ -88,15 +85,6 @@ if($PSBoundParameters.ContainsKey("ProjectName")){ $FolderACL= Get-Acl -Path $folder $FolderACL.SetAccessRule($fileSystemAccessRuleW) Set-Acl -Path $folder.FullName -AclObject $FolderACL - $FolderACL= Get-Acl -Path $folder - $FolderACL.SetAccessRule($fileSystemAccessRuleWR) - Set-Acl -Path $folder.FullName -AclObject $FolderACL - $FolderACL= Get-Acl -Path $folder - $FolderACL.SetAccessRule($fileSystemAccessRuleWAF) - Set-Acl -Path $folder.FullName -AclObject $FolderACL - $FolderACL= Get-Acl -Path $folder - $FolderACL.SetAccessRule($fileSystemAccessRuleWAD) - Set-Acl -Path $folder.FullName -AclObject $FolderACL return $ret }