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 }