From e1458836ce734f7b755c5aeaf0917f6076acb162 Mon Sep 17 00:00:00 2001 From: Karl-Wilfried Zimmer Date: Mon, 15 Jul 2024 20:55:16 +0200 Subject: [PATCH] smal steps --- NewProject2.ps1 | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/NewProject2.ps1 b/NewProject2.ps1 index f7f74ba..64db0ec 100644 --- a/NewProject2.ps1 +++ b/NewProject2.ps1 @@ -65,6 +65,7 @@ if($PSBoundParameters.ContainsKey("ProjectName")){ $FolderACL= Get-Acl -Path $folder $FolderACL.SetAccessRuleProtection($true,$false) + Set-Acl -Path $folder.FullName -AclObject $FolderACL $rid = $ReadTarget.SID $wid = $WriteTarget.SID @@ -80,13 +81,21 @@ if($PSBoundParameters.ContainsKey("ProjectName")){ $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) + Set-Acl -Path $folder.FullName -AclObject $FolderACL + $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