Is it possiable to connect to a LDAP directory of a remote domain on the same network? I am domain XYZ, there is a domain ABC which I am not apart of but I can remote desktop to, how can I write a connection string to connect?
same way would write one for the domain you are a member, i.e. there should be no difference in the syntax on the contents of the query string will change to reflect the domain in question...
i know its strictly not LDAP (well in some respects) but do you see the domain you are interested in in this list??
Set NameSpace = GetObject("WinNT:")
For Each aDomain In Namespace
Wscript.Echo aDomain.Name
Next
Set NameSpace = Nothing
if you can see then you shouldnt have any issues connecting to it....other than you will need to run the script as a user which has rights to the other domain (if there are those sorts of trust issues or whatever) or you will need to include connecting with alternative creditials in your LDAP moniker string.... dont ask me how to do it with the WinNT provider as i dont think i know how to...
Set DSO = GetObject("LDAP:")
Set Container = DSO.OpenDSObject("LDAP://ldap_server_nameip/o=mydomain.com,ou=People", cn="The Don", "password123", 0)
For Each aObject In Container
Wscript.Echo aObject.Get("cn")
Next
No I can not see the domain but I can ping the server.
I tried the connection string you suggested but using the ip address instead of the server name. You have "password123" in the connection, is this for a user account on the domain I am connection to, should there not also be the username?
I get the following error with this connection:
"The server is not operational
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.