Skip to content

Instantly share code, notes, and snippets.

@HarmJ0y
Created October 23, 2014 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HarmJ0y/57f1dac93fcc3564f9b3 to your computer and use it in GitHub Desktop.
Save HarmJ0y/57f1dac93fcc3564f9b3 to your computer and use it in GitHub Desktop.
domain user to sid and sid to user
# user to SID
(New-Object System.Security.Principal.NTAccount("DOMAIN","USER")).Translate([System.Security.Principal.SecurityIdentifier]).Value
# SID to user
(New-Object System.Security.Principal.SecurityIdentifier("SID")).Translate( [System.Security.Principal.NTAccount]).Value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment