Link to home
Start Free TrialLog in
Avatar of omribi
omribi

asked on

simple vbs ldap query (windows 2003)

Hi,
I try to write simple script that query the active directory for current user office number and show it.
I've create connection object and recordset but i dont know how to build exact query.
Can someone help me to build the query or refer me to guide?

Thanks ahead,
Omri.
Avatar of Netman66
Netman66
Flag of Canada image

It's not easy using VBScript to do this.

You can use DSQUERY or DSGET to do this.

If you post a bit more details maybe I can assist.

ASKER CERTIFIED SOLUTION
Avatar of star_trek
star_trek

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of omribi
omribi

ASKER

star_trek - Many Thanks!!
Where i can find the Schema? i need to get the Office Number/Department .. and not the Telephone Number.

Netman - i know how to do it with DSQUERY, but it must be part of other VBS so i need to implement it with VBS.

Thanks.
so it shld be

dept=ouser.department
office=ouser.physicaldelivaryofficename

To get more info on attributes and what they are called you can check adsiedit.msc which is available from the resource kit