Retrieving SID in Powershell
Retrieving a SID can be usually done with psgetsid or whoami /all Here’s a quick snippet to help get you the Secure Identifier (SID) of a local or domain Windows Account within Powershell
1 2 3 |
$u = New-Object System.Security.Principal.NTAccount('username') $SID = $u.Translate([System.Security.Principal.SecurityIdentifier]) $SID.Value |
And here’s an example: In case you need to check the well-known SID, they are listed […]