Skip to content

Instantly share code, notes, and snippets.

@Trucido
Created January 17, 2019 00:39
Show Gist options
  • Save Trucido/ccb024b7d61fb2a74484c75e8d8f9e32 to your computer and use it in GitHub Desktop.
Save Trucido/ccb024b7d61fb2a74484c75e8d8f9e32 to your computer and use it in GitHub Desktop.
param(
[Parameter(ValueFromPipeline=$true)]
$Sid
)
if($Sid)
{
$securityIdentifier = [System.Security.Principal.SecurityIdentifier] $Sid
try
{
$ntAccount = $securityIdentifier.Translate([System.Security.Principal.NTAccount]).ToString()
}
catch{}
$ntAccount
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment