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

Jerold Schulman

January 29, 2004

1 Min Read
ITPro Today logo in a gray background | ITPro Today


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   sdsquery * domainroot -filter "(&(objectCategory=Person)(objectClass=User)(sAMAccountName=*))" -attr * -limit 0dsquery * 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.



Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like