I'm trying to query the AD LDAP without logging into the AD
Domain............

Is there anyway of querying ADs LDAP dbase without logging
on.............. or alternatively is it possible logon using a
vbscript so that I can query ADs LDAP..... this assumes that I am
running the script on a computer that doesn't belong to the domain.

So can I pass a string/command that can login to ADs LDAP via
VBS..........



Thanks

Re: AD LDAP query by star

star
Tue Jan 24 10:09:28 CST 2006

I am not sure if the DC would allow you to get the object before
authicate to it but I feel you try doing this by passing the username
and password with the command line.

cscript <*.vbx> <username> <password>

in the script

objargs=wscript.arguments
username=objargs(0)
password=objargs(1)

oPath=getobject("LDAP:")

oUser=oPath.OpenDSObject("LDAP://<dc-name>/dc=xx, dc=com", username,
password, ads_Server_bind)

OpenDSObject is used for authenticating AD with the given credentials


Re: AD LDAP query by Z

Z
Tue Jan 24 21:22:43 CST 2006

Seems I can't get the above to work ............ my workstation is in a
workgroup and when I run it.... the error "the specified domain either
doesn not exist or could not be contacted" occurs.....

however if I run it on a machine on the domain it executes
fine............. is there any workaround?


Re: AD LDAP query by star

star
Wed Jan 25 13:47:34 CST 2006

instead of using actual domain controller's name try the ip address. so
that would be

oUser=oPath.OpenDSObject("LDAP://<ip-address-of-dc>/dc=xx, dc=com",
username, password, ads_Server_bind)