I am working on a small script which mdifies the ACL on a folderby adding extra permissions; I adm getting the error while I execute "Set-ACL" command; please do let me know what I am doing wrong.
$AddAccessRule = New-Object security.accesscontrol.filesystemaccessrul("CREATOROWNER",@("ReadAndExecute,Synchronize"),"ContainerInherit,Objectinherit","Inheritonly","Allow")
$objacl = get-acl $FolderPath
$ObjAcl.AddAccessRule($AddAccessRule)
Set-acl $FolderPath $objacl
The follwoing error occurs , when i execute it;
Exception calling "AddAccessRule" with "1" argument(s): "Some or all identity references could not be translated." At C:\Users\kakulva\Desktop\Scripts\CreatorOwner\ACL.ps1:10 char:1 + $ObjAcl.AddAccessRule($AddAccessRule) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : IdentityNotMappedException
Let me know if any quetions or clarifications required.