Created
February 10, 2023 13:25
-
-
Save mykappa/b02b0106937f503f94cf21940d831db7 to your computer and use it in GitHub Desktop.
Get current user Security Identifier (SID) with Windows PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$User = New-Object System.Security.Principal.NTAccount($env:UserDomain, $env:UserName) | |
$SID = $User.Translate([System.Security.Principal.SecurityIdentifier]) | |
$SID.Value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment