Computing.Net > Forums > Windows 2000 > adsi scriting -ad query

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

adsi scriting -ad query

Reply to Message Icon

Name: s_hcl
Date: March 21, 2006 at 22:07:09 Pacific
OS: windows 2003 ent server
CPU/Ram: p4/512
Product: ibm
Comment:

I have windows 2003 domain named as tele.com and the domain controller holding all the roles are prod.tele.com.

While creating an adsi script for creating a user ,i tried the following.To try the scripts ,i created an OU named test

using the graphical interface.I wanted to create an User named test1 in that OU.


set objOu=GetObject("LDAP://ou=test,dc=prod,dc=tele,dc=com")
set objUser=objOu.Create("User","cn=test1")
objUser.Put "sAMAccountName","test1"
objUser.Setinfo

when i ran the above script ,it gave me an error ,Object not found ,withthe usual error code.


I moddified the script by changing the LDAP path, as...

set objOu=GetObject("LDAP://ou=test,dc=tele,dc=com")


and it worked...

My query is ,why did not it took the ldap path dc=prod,dc=tele,dc=com..

I had the same problem while restoring an object from an OU.

Any ideas




Sponsored Link
Ads by Google

Response Number 1
Name: Tacticus (by tacticus)
Date: March 29, 2006 at 02:09:52 Pacific
Reply:

To manipulate the AD you don't need to connect to a specific server-the domain is good enough.
If you really need to, though, then the syntax is:

LDAP://servername/CN=Username,CN=users,DC=domain,DC=com


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows 2000 Forum Home


Sponsored links

Ads by Google


Results for: adsi scriting -ad query

Active Directory DNS Configuration www.computing.net/answers/windows-2000/active-directory-dns-configuration/40231.html

creating users using adsi www.computing.net/answers/windows-2000/creating-users-using-adsi/51318.html

Win2000 Server [How can i manage the LDA www.computing.net/answers/windows-2000/win2000-server-how-can-i-manage-the-lda/16875.html