Add special Permissions to directory (group)

Hello everyone, I’m fairly new to ps and need some help with this one.

We have Browse groups, local and global.

Global goes into local and browse. Browse is on the root folder, while local is on the subfolder.

Browse should be this folder only.

My question is:

  1. I cant add the Browse Group with the advanced permission error: powershell cannot find an overload for filesystemaccessrule and the argument count: "8"
 

Should look like this in the end:

https://imgur.com/a/Qrhijwt

 

#Add group to folder (Browse Gruppe)

$aclB = Get-Acl \srv\Dat$\Da

$AccessRuleB = New-Object System.Security.AccessControl.FileSystemAccessRule("$BGruppeName", "ExecuteFile", "ReadData", "ReadAttributes", "ReadExtendedAttributes", "None", "Read", "Allow")

$aclB.SetAccessRule($AccessRule)

$aclB | Set-Acl \srv\Dat$\Da

D44, welcome to Powershell.org. Please take a moment and read the very first post on top of the list of this forum: Read Me Before Posting! You’ll be Glad You Did! and Guide To Posting Code.

Thanks in advance.

As far as your question, SetAccessRule has specific things that it accepts and you are not providing a valid value. Take a look at this:

https://blog.netwrix.com/2018/04/18/how-to-manage-file-system-acls-with-powershell-scripts/

When you start getting complex permissions, it’s often better to set the permissions on a template object (i.e. Folder\File) and then use Get-Acl to get the permissions and then add users or adjust if necessary.