Monday, December 10, 2007

Convert SID to NTAccount with Powershell

Here's a quick script to convert a given SID (e.g. S-1-0-234...) to a NT Account (e.g. DOMAIN\user):

$sid = new-object System.Security.Principal.SecurityIdentifier "S-1-0-234..."

$ntacct = $sid.Translate([System.Security.Principal.NTAccount])

No comments: