Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Error using Set-ACL on NAS Share

$
0
0

Hi all,

I'm trying to create homefolders using a script.

One of the steps is to disable inheritance and removing the "domain users" permissions.

Our homefolders are located on a Synology NAS.

I use the following lines:

$acl = Get-Item $Path |get-acl
# This removes inheritance
$acl.SetAccessRuleProtection($true,$true)
$acl |Set-Acl

$acl = Get-Item $Path |get-acl
# This removes all access for the group in question
$acl.Access |where {$_.IdentityReference -eq "KOLBS\Domain Users"} | %{$acl.RemoveAccessRule($_)}
$acl |Set-Acl

When the script gets to the part where it has to apply the ACL, it throws the following error:

set-acl : Method failed with unexpected error code 1.
At line:1 char:1
+ set-acl -path ***PATHTOTHEHOMEFOLDER*** -aclobject $acl
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (***PATHTOTHEHOMEFOLDER***:String) [Set-Acl], InvalidOperat
   ionException
    + FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.PowerShell.Commands.SetAclCommand

Does anybody have any experience in setting rights on a Synology NAS share?
Thanks in advance!

Filip


Viewing all articles
Browse latest Browse all 21975

Trending Articles



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