Home > Sysadmin > Fetch the SID of a user account using PowerShell

Fetch the SID of a user account using PowerShell


If you want to find-out the SID of a Domain(or local) user using powershell, here is the code.

Get the SID of domain User:

write-host (new-object System.Security.Principal.NTAccount “domainuser”).Translate([System.Security.Principal.SecurityIdentifier]) -b yellow -f red

Get the SID of local User:

write-host (new-object System.Security.Principal.NTAccount “administrator”).Translate([System.Security.Principal.SecurityIdentifier]) -b yellow -f red

If you are a programming geek and want to convert this into cmdlet(say get-sid), you can find some info here at http://www.clariusconsulting.net/blogs/pga/archive/2006/08/08/643.aspx
Happy Learning,

Sitaram Pamarthi

Categories: Sysadmin
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>