Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Powershell ntfs rights to a folder

$
0
0

Hi,

I am trying to make a powershell script that can set permission of a group to a folder.
At this moment i have

New-Item -ItemType directory -Path \\127.0.0.1\Home$\\test

$acl = Get-Acl \\127.0.0.1\Home$\\test

$arguments = "REND\GroupA","ReadAndExecute", "ContainerInherit, ObjectInherit", "None", "Allow"

$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule $arguments

$acl.SetAccessRule($accessRule)

$acl | Set-Acl \\127.0.0.1\Home$\\test


What i want to do is to set the same group 2 times but with diffrent settings.
If i do this in windows security i can do it in advanced but with powershell it cant.

1: GroupA --> Write Allow (Not inherrited)
2: GroupA --> Read Allow (Inherrited)

How can i do this in powershell ?

Greetings

Marcel


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>