Classic ASP to Query Active Directory Contacts

I have a classic ASP page that I use as a phonebook which queries against Active Directory.

I would like to add another function where it can also query Active Directory for contacts. I have over 100 fax machines that I want users to be able to look up. Our Active Directory Admin create a Contact for each one, and in the last name field called it FAX.

Here is the Query String I'm using to return users in AD and it works fine.

objCom.CommandText ="select name,telephonenumber,mobile,facsimileTelephoneNumber,pager,mail,l,physicalDeliveryOfficeName,company,title,department,sAMAccountName,sn,userAccountControl,msexchhidefromaddresslists FROM 'GC://"+objADsPath+"' where name = '*" & usrname & "*' ORDER BY name "'"
I'm assuming a new query string for Contacts should be just as simple but I can not find any reference material to know what object names to be using.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Shaun KlineLead Software EngineerCommented:
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
I don't have a way to test this right now but this EE question looks to be on target for what you want to do
Big MontySenior Web Developer / CEO of Commented:
i believe you want:

objCom.CommandText ="select fax FROM 'GC://" & objADsPath & "' where (objectCategory=computer)"

Open in new window

note I changed

+ objADsPath +


 & objADsPath &

I'm assuming you're using server side vbscript (which is the default language for classic asp). If you're using server side javascript, then continue with the format you were using

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Applications

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.