how to write script for creating users automatically(altogether) in windows 2000 server domain?

Hi...
We rebuilt our PDC...Now we want to create all users through script...

how to write script for creating user in windows 2000 server domain?
What is the syntax?

For eg: User name is "Joji Joseph" and logon ID should be "joji" in group IT

Awaiting ur quick reply...

Thanks...
Joji
JojiJoseph_1975Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tecki_TrojansCommented:
Hello Bro
Let me know if this works for u .....................


' Taken from ADS_USER_FLAG_ENUM
Const ADS_UF_NORMAL_ACCOUNT = 512

set objParent = GetObject("LDAP://<ParentDN>")
set objUser   = objParent.Create("user", "cn=<UserName>") ' e.g. joes
objUser.Put "sAMAccountName", "<UserName>"   ' e.g. joes
objUser.Put "userPrincipalName", "<UserUPN>" ' e.g. joes@rallencorp.com
objUser.Put "givenName", "<UserFirstName>"   ' e.g. Joe
objUser.Put "sn", "<UserLastName>"           ' e.g. Smith
objUser.Put "displayName", "<UserFirstName> <UserLastName>" ' e.g. Joe Smith

' CORRECTION: If you don't set userAccountControl, then by default
'             the value of 514 (normal account + disabled) will be set for it.
'             In this instance by setting it to 512, the account will not
'             be disabled, and if you have password complexity enabled in
'             your forest, the script will fail because a password was not
'             set prior to the account being enabled.  The solution is to
'             not set userAccountControl here.
' objUser.Put "userAccountControl", ADS_UF_NORMAL_ACCOUNT

objUser.SetInfo
objUser.SetPassword("<Password>")
objUser.AccountDisabled = FALSE
objUser.SetInfo


Enjoy ..........

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GuruGaryCommented:
Are you trying to automate adding a bunch of users at one time?  This will do one at a time ...

For a batch file, you could use the "net user" and "net group" commands to accomplish your task.  For example, if you want to use it to set up the 3 fields you entered above (with an initial default password of "password"), you could save the following as "userscript.bat":

@echo off
net user %2 password /add /fullname:%1
net group IT %2 /add

Then just run it like:
userscript "Joji Joseph" joji IT
Dark_KingCommented:
Dark_KingCommented:
If you dont have "Resource Kit for Windows 2000 " you can download Add Users from here.
http://www.dynawell.com/support/Reskit/win2k.asp
Dark_KingCommented:
Sorry for the wrong writing in last post.

If you don’t find your "Resource Kit for Windows 2000" you can download Add Users from here.
http://www.dynawell.com/support/Reskit/win2k.asp
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Operating Systems

From novice to tech pro — start learning today.