First query a specific user using their username - example below using the username 'bob' This will return the user LDAP DN (Distinguished Name)

C:\Users\admin.LAB2>dsquery user -samid bob
"CN=Bob Bobster,CN=Users,DC=lab2,DC=purplepi,DC=ie"

Then query LDAP with that DN to show you all of that users attributes

C:\Users\admin.LAB2>dsquery * "CN=Bob Bobster,CN=Users,DC=lab2,DC=purplepi,DC=ie" -attr *
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: user
cn: Bob Bobster
sn: Bobster
title: Bobs Job Title
description: Bob's Description
physicalDeliveryOfficeName: Bob's Office Name!
telephoneNumber: 12022
givenName: Bob
distinguishedName: CN=Bob Bobster,CN=Users,DC=lab2,DC=purplepi,DC=ie
instanceType: 4
whenCreated: 10/23/2018 17:35:17
whenChanged: 04/16/2020 18:05:53
displayName: Bob Bobster
uSNCreated: 66803
memberOf: CN=IVRAdmin,CN=Users,DC=lab2,DC=purplepi,DC=ie
memberOf: CN=Cisco_ICM_Config,OU=Cisco_ICM,DC=lab2,DC=purplepi,DC=ie
uSNChanged: 1474843
department: Bob Department
company: Purple
name: Bob Bobster
objectGUID: {E504F2F2-A6E2-4112-949B-A31EAA6786A9}
userAccountControl: 66048
badPwdCount: 0
codePage: 0
countryCode: 0
badPasswordTime: 0
lastLogoff: 0
lastLogon: 0
pwdLastSet: 132311557947751460
primaryGroupID: 513
objectSid: S-1-5-21-3443183386-3702885658-3434720438-1131
accountExpires: 9223372036854775807
logonCount: 0
sAMAccountName: bob
sAMAccountType: 805306368
userPrincipalName: bob@lab2.purplepi.ie
objectCategory: CN=Person,CN=Schema,CN=Configuration,DC=lab2,DC=purplepi,DC=ie
dSCorePropagationData: 08/09/2019 14:15:51
dSCorePropagationData: 01/01/1601 00:00:01
lastLogonTimestamp: 132311583094043893
mail: bob@purplepi.ie
manager: CN=Alice Anderson,CN=Users,DC=lab2,DC=purplepi,DC=ie
ADsPath: LDAP://LAB2-AD-01.lab2.purplepi.ie/CN=Bob Bobster,CN=Users,DC=lab2,DC=purplepi,DC=ie

Install the below Role.

Settings → Apps → Optional features → RSAT: Active Directory Domain Services and Lightweight Directory Services Tools

  • vendors/microsoft/ad/dsquery.txt
  • Last modified: 2020/04/17 08:55
  • by gerardorourke