troubleshooting Question

List only enabled Active Directory Users

Avatar of tahlequahitguys
tahlequahitguysFlag for United States of America asked on
ASPActive DirectorySQL
9 Comments2 Solutions689 ViewsLast Modified:
Last year, I created (pieced together from others) a directory of all of our users. However, it was just pointed out to me that the directory is also listing "disabled" users.

How can I list "enabled" users and not "disabled"?


If possible I'd like to add this to my query, but I'm open to if statements. Here's my query and my main loop:
'Query

SQLStmt = "SELECT mailNickname, description, displayName, givenName, sn, streetAddress, l, st, " &_
 "postalCode, homePhone, mobile, title, department, company, physicalDeliveryOfficeName, " &_
 "telephoneNumber, facsimileTelephoneNumber FROM 'LDAP://SERVER/" & myLDAP &_
 "' WHERE objectClass='Person' AND description <>'Student' ORDER BY mailNickname"


'The Loop

Do while not objRS.EOF and RowCount < objRS.PageSize

   'list user info

loop

Thanks for any help you can give.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 9 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros