Find SID of Account Using PowerShell

Different ways to find the SID of objects in Active Directory.

John Savill

October 14, 2015

1 Min Read
Find SID of Account Using PowerShell

For more technical explainers on PowerShell, read our updated 2021 report: PowerShell 101: A Technical Explainer for IT Pros.

Q. How can I find the SID of a user or other object using PowerShell?

A. There are a number of different methods to find the SID of an object. A simple way is as follows:

$name = '[email protected]'(New-Object System.Security.Principal.NTAccount($name)).Translate([System.Security.Principal.SecurityIdentifier]).value

Simply change the name of the object in the $name variable. Note the above is really a condensed version of:

$AdObj = New-Object System.Security.Principal.NTAccount('[email protected]')$strSID = $AdObj.Translate([System.Security.Principal.SecurityIdentifier])$strSID.Value

Another option to find the name of a user account is using Get-ADUser:

Get-ADUser -Identity 'honeypot' | select SID

You could also use Get-ADGroup and other cmdlets for other types of object.

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like