fixed acl issue
This commit is contained in:
parent
ddaa5a3305
commit
eeb8abbd45
@ -67,16 +67,13 @@ if($PSBoundParameters.ContainsKey("ProjectName")){
|
|||||||
|
|
||||||
$rid = $ReadTarget.Name
|
$rid = $ReadTarget.Name
|
||||||
$wid = $WriteTarget.Name
|
$wid = $WriteTarget.Name
|
||||||
$fsrr = "Read"
|
$fsrr = "ReadAndExecute"
|
||||||
$fsrr = "Write"
|
$fsrw = "Write"
|
||||||
$type = "Allow"
|
$type = "Allow"
|
||||||
$fsarar = @($rid,$fsrr,,,$type)
|
|
||||||
$fsaraw = @($wid,$fsrw,,,$type)
|
|
||||||
$fsarawr = @($wid,$fsrr,,,$type)
|
|
||||||
|
|
||||||
$fileSystemAccessRuleR = New-Object -TypeName System.Security.AccessControl.FileSystemAccessRule -ArgumentList $fsarar
|
$fileSystemAccessRuleR = New-Object System.Security.AccessControl.FileSystemAccessRule($rid,$fsrr,"ContainerInherit, ObjectInherit",,$type)
|
||||||
$fileSystemAccessRuleW = New-Object -TypeName System.Security.AccessControl.FileSystemAccessRule -ArgumentList $fsaraw
|
$fileSystemAccessRuleW = New-Object System.Security.AccessControl.FileSystemAccessRule($Wid,$fsrw,"ContainerInherit, ObjectInherit",,$type)
|
||||||
$fileSystemAccessRuleWR = New-Object -TypeName System.Security.AccessControl.FileSystemAccessRule -ArgumentList $fsarawr
|
$fileSystemAccessRuleWR = New-Object System.Security.AccessControl.FileSystemAccessRule($rid,$fsrr,"ContainerInherit, ObjectInherit",,$type)
|
||||||
|
|
||||||
$FolderACL.SetAccessRule($fileSystemAccessRuleR)
|
$FolderACL.SetAccessRule($fileSystemAccessRuleR)
|
||||||
$FolderACL.SetAccessRule($fileSystemAccessRuleW)
|
$FolderACL.SetAccessRule($fileSystemAccessRuleW)
|
||||||
|
Loading…
Reference in New Issue
Block a user