Hi Guys,
I’m quite new to powershell and trying to use the Get-ACL and set-acl cmdlets to change a folder permission on a new folder.
i have set a $paste for the username so for example would be jack.smith
i am trying to create the folder with
FileSystemRights : DeleteSubdirectoriesAndFiles, Modify, Synchronize
AccessControlType : Allow
IdentityReference : USERNAME
IsInherited : False
InheritanceFlags : ContainerInherit, ObjectInherit
PropagationFlags : None
but i get an error when trying to create a permissions object like below:
PS C:\Users\xxxxx> $Perms = New-Object system.security.accesscontrol.
filesystemaccessrule("$paste$","DeleteSubdirectoriesAndFiles","Modify","Synchron
ize","ContainerInherit","ObjectInherit")
New-Object : Cannot find an overload for "FileSystemAccessRule" and the argumen
t count: "6".
At line:1 char:20
+ $Perms = New-Object <<<< system.security.accesscontrol.filesystemaccessrule
("$paste$","DeleteSubdirectoriesAndFiles","Modify","Synchronize","ContainerInhe
rit","ObjectInherit")
+ CategoryInfo : InvalidOperation: (:) [New-Object], MethodExcept
ion
+ FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.Power
Shell.Commands.NewObjectCommand
any help would be great!