Error on typing a simple script- The specified directory attribue or value - TechRepublic
Question
February 18, 2008 at 10:12 PM
rajnair7

Error on typing a simple script- The specified directory attribue or value

by rajnair7 . Updated 18 years, 4 months ago

Hello all,

I typed a simple script to create 6 users for testing another thing in my laptop.

Here is the adsi script
—————————
‘Script to create 6 users in AD( windows 2003)
set objrootdse = getobject (“LDAP://rootdse”)
set objcontainer = getobject(“LDAP://cn=users,” & objrootdse.get(“defaultnamingcontext”))
For i=1 to 6
set objuser = objcontainer.create (“TestUser”,”cn=testuser” & i)
objuser.samaccountname = “testuser” & i
objuser.setinfo
Next
wscript.echo “6 users created”

Th error i get is \\path to script.vbs(7,1)(null) The specified directory attribue or value does not exist. Here i dont any clue why the “objuser.setinfo” is erroring out.
If i remove that line, then script completes without any error, but obviously dont create anything.

This discussion is locked

All Comments