JSI Tip 7714. What attribute names can I use with the user filtered dsquery command?


When you use the DSQUERY command with the -filter and -attr switches, you can specify Active Directory attribute names that you want output, as in the following examples:

                                         F     i     l     t     e     r                            A   t   t   r   i   b   u   t   e   s
dsquery * domainroot -filter "(&(objectCategory=Person)(objectClass=User)(sAMAccountName=*))" -attr * -limit 0
dsquery * domainroot -filter "(&(objectCategory=Person)(objectClass=User)(sAMAccountName=*))" -attr distinguishedName department manager -L -limit 0
NOTE: The -attr * causes all attributes for the filtered accounts to be displayed. The -L causes the attribute name and value to be displayed in a vertical presentation.

NOTE: See More on DSQUERY attribute filtering.

Following is the list of most user attributes, and where necessary, a brief description encapsulated in () marks:

accountExpires 
adminCount 
ADsPath 
badPasswordTime 
badPwdCount 
c  (2 digit country)
cn (Container)
co (Country Name)
codePage 
comment 
company 
countryCode 
department 
description 
directReports 
displayName 
distinguishedName 
dSCorePropagationData 
facsimileTelephoneNumber 
givenName 
homeDirectory 
homeDrive 
homePhone 
info (Phone notes)
initials 
instanceType 
ipPhone 
isCriticalSystemObject 
l   (City)
lastLogoff 
lastLogon 
lastLogonTimestamp 
logonCount 
logonHours 
mail 
manager 
memberOf 
mobile 
msNPAllowDialin 
name 
objectCategory 
objectClass 
objectGUID 
objectSid 
otherFacsimileTelephoneNumber 
otherHomePhone 
otherIpPhone 
otherMobile 
otherPager 
otherTelephone 
pager 
physicalDeliveryOfficeName 
postalCode 
postOfficeBox 
primaryGroupID 
profilePath 
pwdLastSet 
sAMAccountName 
sAMAccountType 
scriptPath 
servicePrincipalName 
showInAdvancedViewOnly 
sn (Surname)
st (2 digit State / Province)
streetAddress 
telephoneNumber 
title 
url 
userAccountControl 
userCertificate 
userParameters 
userPrincipalName 
userWorkstations 
uSNChanged 
uSNCreated 
whenChanged 
whenCreated 
wWWHomePage
NOTE: If you discover additional standard user attributes, feel free to contact me.



Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish