I have this powershell code.
$securityidentifier = new-object security.principal.securityidentifier $sid
$user = ( $securityidentifier.translate( [security.principal.ntaccount] ) )
This code only works on a computer that is in the same domain as the user whose SID I would like to transfer to ntaccount.
Can I transfer the SID to ntaccount if you are not part of a domain, but you have a domain username and password for this 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
source
share