adsi scriting+windows 2000 ads query
Results 1 to 6 of 6

Thread: adsi scriting+windows 2000 ads query

  1. #1
    Join Date
    Dec 2005
    Posts
    53

    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

  2. #2
    Join Date
    Feb 2001
    Location
    Adelaide, South Australia
    Posts
    6,447
    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.

  3. #3
    Join Date
    Dec 2005
    Posts
    53
    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

  4. #4
    Join Date
    Feb 2001
    Location
    Adelaide, South Australia
    Posts
    6,447
    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.

  5. #5
    Join Date
    Dec 2005
    Posts
    53

    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

  6. #6
    Join Date
    Feb 2001
    Location
    Adelaide, South Australia
    Posts
    6,447
    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
  •