Translating SID to Username

by Oct 13, 2016

Ever wanted to translate a security identifier (SID) to the real name? Here is a function helping you:

#requires -Version 3.0

function ConvertFrom-SID
    $objSID = New-Object System.Security.Principal.SecurityIdentifier($sid)
    $objUser = $objSID.Translate( [System.Security.Principal.NTAccount])

You can submit a SID as an argument, or pipe one or multiple SIDs to the function.

Twitter This Tip! ReTweet this Tip!