I have this powershell code.
$securityidentifier = new-object security.principal.securityidentifier $sid
$user = ( $securityidentifier.translate( [security.principal.ntaccount] ) )
This code works only on a computer which is in the same domain as the user whose SID I would like to translate to ntaccount.
Is it possible to translate SID to ntaccount if you are not part of the domain, but you have domain username and password for that domain ?
Still the same error.
Exception calling "Translate" with "1" argument(s): "Some or all identity references could not be translated."
At C:\...\test.ps1:7 char:40
+ $user = ( $securityidentifier.translate <<<< ( [security.principal.ntaccount] ) )
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException