Set-ACL Error

Home Forums Scripting PowerShell Set-ACL Error

Viewing 1 post (of 1 total)
  • Author
    Posts
  • Avatar
    danny230681
    Member
    #164372

    Hello all,

    I am trying to set special permissions on a folder however if i use more than 3 arguments i get an error: Cannot find an overload for “FileSystemAccessRule”and the argument count …..

    It looks like if i use more than 3 arguments it shows this behaviour.

    My code looks like:

    $Profiles = “PATH TO FOLDER”
    $acl_Profiles = Get-Acl $Profiles

    $acl_Profiles.SetAccessRuleProtection($true,$false)

    $Users = “BUILTINUsers”,”CreateFiles”, “AppendData”, “ReadExtendedAttributes”, “ExecuteFile”, “ReadAttributes”, “ReadPermiss”, “Allow”

    $accessRule6 = New-Object System.Security.AccessControl.FileSystemAccessRule $Users
    $acl_Profiles.SetAccessRule($accessRule6)

    $acl_Profiles | Set-Acl $Profiles[/CODE]

    Is someone familiar with this?[CODE]$Profiles = “PATH TO FOLDER”
    $acl_Profiles = Get-Acl $Profiles

    $acl_Profiles.SetAccessRuleProtection($true,$false)

    $Users = “BUILTINUsers”,”CreateFiles”, “AppendData”, “ReadExtendedAttributes”, “ExecuteFile”, “ReadAttributes”, “ReadPermiss”, “Allow”

    $accessRule6 = New-Object System.Security.AccessControl.FileSystemAccessRule $Users
    $acl_Profiles.SetAccessRule($accessRule6)

    $acl_Profiles | Set-Acl $Profiles[/CODE]

    Is someone familiar with this?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.