We are trying to use powershell script to add user to a CIFS folder.
The user is a local NetApp CIFS user.
How could we resolved it?
PS C:\Users\a5115049> $ACL = Get-ACL -Path \\10.165.161.139\TestProg_vol\FTI
PS C:\Users\YYY> $AccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("10.165.161.139\sysadmin","Delete","Deny")
PS C:\Users\YYY> $ACL.SetAccessRule($AccessRule)
Exception calling "SetAccessRule" with "1" argument(s): "Some or all identity references could not be translated."
At line:1 char:1
+ $ACL.SetAccessRule($AccessRule)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : IdentityNotMappedException
If we tried the following it comes with different error message
PS C:\Users\YYY> $AccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("sysadmin.10.165.161.139.LOCAL","Delete","Deny")
PS C:\Users\YYY> $ACL.SetAccessRule($AccessRule)
Exception calling "SetAccessRule" with "1" argument(s): "The trust relationship between the primary domain and the trusted domain failed.
However if we use the FileExplorer security tab to add, there is no issue.