I'm trying to change some NTFS permissions using UNC Path on Powershell. I only have access to this folder using \\hostname\folder.
I need to modify the NTFS permissions, not the Shared Permissions.
I'm trying this:
$Pathv6 = '\\MyHostname\folder'
$acl = Get-Acl $Pathv6
$acl.SetAccessRuleProtection($true,$false)
$ar = new-object System.Security.AccessControl.FileSystemAccessRule('User01', 'Modify',"ContainerInherit, ObjectInherit","None","Allow")
$acl.AddAccessRule($ar)
set-acl -Path $Pathv6 -AclObject $acl
This code show the error:
set-acl : No se pudieron convertir algunas o todas las referencias de identidad.
At C:\Datos\ArregloACL.ps1:37 char:5
+ set-acl -Path $Pathv6 -AclObject $acl
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (\\MyHostname\...\Client.v6:String) [Set-Acl], IdentityNotMappedException
+ FullyQualifiedErrorId : System.Security.Principal.IdentityNotMappedException,Microsoft.PowerShell.Commands.SetAclCommand
How can I modify the NTFS permissions using UNC and Powershell?