s_hcl Posted March 23, 2006 Share Posted March 23, 2006 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 testusing 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.Setinfowhen 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 Link to comment Share on other sites More sharing options...
nmX.Memnoch Posted March 23, 2006 Share Posted March 23, 2006 Because prod.tele.com is the name of your domain controller. When doing LDAP queries you want to use the name of the Active Directory Domain...which in your case is tele.com. What you observed is the expected behavior. Link to comment Share on other sites More sharing options...
tguy Posted June 7, 2006 Share Posted June 7, 2006 Maybe this ADSI script will help. Look into the RootDSE...Set objRootDSE = GetObject("LDAP://rootDSE")Set objContainer = GetObject("LDAP://OU=ADTEST,OU=APPS,OU=CAMPUS," & _ objRootDSE.Get("defaultNamingContext"))For i = 1 To 100 Set objLeaf = objContainer.Create("User", "cn=Test" & i) objLeaf.Put "sAMAccountName", "Test" & i objLeaf.SetInfo objLeaf.SetPassword("password" & i) objLeaf.AccountDisabled = False objLeaf.SetInfoNextWScript.Echo "100 Users created." Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now