Difference between revisions of "How to get the AD object security ID (SID)"

From Tech-Wiki
Jump to: navigation, search
(Created page with "Category:Microsoft How to obtain the Active Directory Security ID for an object. First get the distinguished name (DN) of the object. This can be performed using the dsquer...")
 
Line 17: Line 17:
 
   sid
 
   sid
 
   S-1-5-21-2560XXXX-XXXXX-XXXXX-19440
 
   S-1-5-21-2560XXXX-XXXXX-XXXXX-19440
dsget succeeded
+
  dsget succeeded

Revision as of 07:11, 12 May 2012


How to obtain the Active Directory Security ID for an object.

First get the distinguished name (DN) of the object. This can be performed using the dsquery utility. From the Command Prompt.

dsquery user -name "Joe Bloggs"

Example Output:

"CN=Joe Blogs,OU=Users,DC=contoso,DC=com"


Next use the dsget utility, along with the DN to obtain the sid:

dsget user "CN=Joe Blogs,OU=Users,DC=Contoso,DC=com" -sid

Example Output:

 sid
 S-1-5-21-2560XXXX-XXXXX-XXXXX-19440
 dsget succeeded