dsquery

dsquery command – Sergio

dsquery group -samid “REL 73 Global” -d RSACFAMILY | dsget group -members | dsget user -samid
dsquery user -samid “userid” | dsget user -memberof | dsget group -samid

C:\>dsquery * -Filter “(samaccountname=REL HR Global)” -Attr sIDHistory
sIDHistory
S-1-5-21-1417001333-73586283-682003330-8661

SID for CORP\Human Resources Global

S-1-5-21-1417001333-73586283-682003330-8661

C:\>dsquery * -filter “&(objectcategory=group)(samaccountname=Human Resources Global)” -attr objectsid
objectsid
S-1-5-21-

C:\>dsquery * -filter “&(objectcategory=group)(objectsid=S-1-5-21-3800660102-2952205422-746764765-5087)” -attr samaccountname
samaccountname
Mercury Human Resources1417001333-73586283-682003330-8661

Advertisements

Categories: dsquery, IT, PowerShell

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s