Compare commits
2 Commits
cdfca3256f
...
5a964bafe6
Author | SHA1 | Date | |
---|---|---|---|
|
5a964bafe6 | ||
|
b0175da17a |
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user