rieskaniemi.com

yet another it blog

Convert SID to username using PowerShell

powershell logo

Many times when inspecting logs you may encounter security identifiers (SID) instead of usernames.

What if you would like to know the account behind this security identifier?

This can be easily done with few line of PowerShell.

$SID = New-Object System.Security.Principal.SecurityIdentifier("“"S-1-5-21-2553378220-2497456894-4783514835-1225")
$User = $SID.Translate([System.Security.Principal.NTAccount])
$User.Value

Sid to username

Simple and quick.

Tagged

Leave a Reply

Your email address will not be published. Required fields are marked *