A. Dsquery can output many object attributes, including the SID (objectSID). The easiest way is to use a filter query to show the objectsid attribute, as in the following example:
dsquery * -filter "&(objectcategory=user)(samaccountname=john)" -attr objectsid
The return is:
objectsid S-1-5-21-2835294230-785241407-2532694646-1106
You can also use Dsget to get the distinguished name (DN), like the following example:
dsget user "cn=john savill,cn=users,dc=savilltech,dc=net" -sid
The return would be:
sid S-1-5-21-2835294230-785241407-2532694646-1106 dsget succeeded
0 comments
Hide comments