Home > Active Directory, Microsoft, PowerShell > PowerShell: Get SID from AD (Active Directory) User / Group using PowerShell

PowerShell: Get SID from AD (Active Directory) User / Group using PowerShell

To get the SID of an AD Object (User, Group, whatever) quickly, i recommend using PowerShell.
When trying to get the SID using ADUC (Active Directory User and Computer Snap-in), you can not copy/paste the SID as a string since it is stored in a binary format.

ActiveDirectory_AttributeEditor_ObjectSID

ActiveDirectory_AttributeEditor_ObjectSID

ActiveDirectory_AttributeEditor_ObjectSID_Binary

ActiveDirectory_AttributeEditor_ObjectSID_Binary

Now, to get the SID (Security Identifier) for a specific (AD) Active Directory Object using PowerShell use:

$AdObj = New-Object System.Security.Principal.NTAccount("ObjectName")
$strSID = $objUser.Translate([System.Security.Principal.SecurityIdentifier])
$strSID.Value
PowerShell_Get_SID

PowerShell_Get_SID

Categories: Active Directory, Microsoft, PowerShell Tags:
  1. No comments yet.
  1. No trackbacks yet.
Notify me of follow-up comments via email.