|
-
March 22nd, 2006, 02:28 AM
#1
adsi scriting+windows 2000 ads query
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
-
March 23rd, 2006, 08:45 AM
#2
Because the OU exists in the domain (tele.com), not just on a particular server. Look in Active Directory Users and Computers -- your OUs are just under the tele.com node; there's no prod.tele.com item in the tree.
Safe computing is a habit, not a toolkit.
-
March 24th, 2006, 01:41 AM
#3
ok got it ,since the root is tele.com ,so if i have created a child domain ,say
fin.tele.com ,will it work .I will try installing a child domain and check out.
I m new to scripting,in a production environment which scripts are generally used vbscript or wsh and what is generally scripted.
ur inputs would be helpful
-
March 24th, 2006, 07:22 AM
#4
If you have a child domain called fin.tele.com, then you'd use something like LDAP://ou=test,dc=fin,dc=tele,dc=com to work with OUs in that domain.
In terms of production scripting, use whatever you and your co-workers are most comfortable with. Remember that the only two languages which exist on a machine by default are VBScript and JScript; to use something like Perl or Python it needs to be installed separately.
I've been starting to VBScript a few things at work (just replacement login scripts etc, no WMI or ADSI stuff yet), and I've found the Microsoft Script Centre to be really useful. There's a lot of stuff to read, but generally I can find what I need to accomplish a given task I have in mind.
Safe computing is a habit, not a toolkit.
-
March 24th, 2006, 08:49 AM
#5
adsi scriting+windows 2000 ads query
thks for the same.i got the concept of LDAP path.
i just wanted to confirm that the adsi scripting which i had submiited ,is it used in a real production enviornment ,as i save it as a vbs file.
In vb scripts ,the syntax is different ,hence ...
and secondly,do u use scripts for user creation,deletion
fsmo roles ,etc.
sorry for troubling u ,but i needed to confirm ,as i m not into fulltime scripting.
i had visited the MS script centre and its good.
thks
-
March 24th, 2006, 11:20 AM
#6
I haven't done any of that stuff with scripting yet, but it's certainly one of the common applications for scripting. Personally I only script stuff when I have to, or when I think it'll be the most efficient long-term solution.
Safe computing is a habit, not a toolkit.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|