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

From Tech-Wiki
Jump to: navigation, search
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
[[Category:Microsoft]]
 
[[Category:Microsoft]]
 +
'''[[Microsoft#Active Directory|Back to Active Directory]]'''
  
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.
+
How to obtain the Active Directory Security ID (SID) for an object.
 +
 
 +
First obtain the distinguished name (DN) of the object. In this example the 'dsquery' utility has been used.
 
From the Command Prompt.
 
From the Command Prompt.
 
  dsquery user -name "Joe Bloggs"
 
  dsquery user -name "Joe Bloggs"
  
 
Example Output:
 
Example Output:
  "CN=Joe Blogs,OU=Users,DC=contoso,DC=com"
+
  "CN=Joe Bloggs,OU=Users,DC=contoso,DC=com"
  
  
Next use the dsget utility, along with the DN to obtain the sid:
+
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
+
  dsget user "CN=Joe Bloggs,OU=Users,DC=Contoso,DC=com" -sid
  
 
Example Output:
 
Example Output:

Latest revision as of 10:12, 24 August 2016

Back to Active Directory


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

First obtain the distinguished name (DN) of the object. In this example the 'dsquery' utility has been used. From the Command Prompt.

dsquery user -name "Joe Bloggs"

Example Output:

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


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

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

Example Output:

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