Link to home
Start Free TrialLog in
Avatar of hadame
hadame

asked on

CREATEUSERS.VBS SCRIPT FOR ACTIVE DIRECTORY

DOES ANYBODY KNOWS HOW TO USE THIS CREATEUSERS.VBS SCRIPT?
IT COMES IN THE W2K RESOURCE KIT. IT ALLOWS YOU TO IMPORT USERS TO ACTIVE DIRECTORY EASILY, BUT I FOUND IT TO BE VERY HARD.  ANY HELP?
Avatar of Housenet
Housenet
Flag of Canada image

-Not really.. But I have used ldifde.exe to export & import users.. Easy... You already have a copy in winnt\system32.

-Here's how I've used it..
-Say you had a DC in a 2000 domain called myserver & the FQDN for the domain was mycity.mydomain.com. Full host name is myserver.mycity.mydomain.com

1. Create a Batch file called exportusers.bat & copy-paste the following into it.

ldifde -f Exportuser.ldf -s myserver -d "dc=mycity,dc=mydomain,dc=com" -p subtree -r "(&(objectCategory=person)(objectClass=User)(givenname=*))" -l "cn,givenName,objectclass,samAccountName"

-This would export your users to a file called exportuser.ldf & contain info that basically looks like this..

dn: CN=User1,CN=Users,DC=mycity,DC=mydomain,DC=com
changetype: add
cn: User1
givenName: User1
objectClass: user
sAMAccountName: User1

dn: CN=JoeBlow,CN=Users,DC=mycity,DC=mydomain,DC=com
changetype: add
cn: JoeBlow
givenName: JoeBlow
objectClass: user
sAMAccountName: JoeBlow

-You modify the CN info & import the users to CN=Users or any OU with this batch file.
Import Users.bat
ldifde -i -f Exportuser.ldf -s myserver



-If you would like to incluse more info or need further help, check out the article... http://support.microsoft.com/support/kb/articles/Q237/6/77.ASP?LN=EN-US&SD=gn&FR=0&qry=q237677&rnk=1&src=DHCS_MSPSS_gn_SRCH&SPR=W2KHMUSE
Avatar of hadame
hadame

ASKER

I'm using that utility, but I get these errors:

Connecting to "server1"
Logging in as current user using SSPI
Importing directory from file "import.ldf"
Loading entries.
Add error on line 1: No Such Object
The server side error is "Directory object not found."
0 entries modified successfully.
An error has occurred in the program

Import file looks like:

dn: CN=test1,OU=users,DC=domain,DC=net
changetype: add
cn: test 1
givenName: test1
objectClass: user
sAMAccountName: test1

dn: CN=test2,OU=users,DC=domain,DC=net
changetype: add
cn: test 2
givenName: test2
objectClass: user
sAMAccountName: test2

I'm executing the same ldifde import command that you've posted on the server.

Any suggestions?

ASKER CERTIFIED SOLUTION
Avatar of Housenet
Housenet
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hadame

ASKER

Housenet, It worked, but how do you get to import the comma delimited file? or how do you create the import file to place that text in different fields?
Let's assume the same information:

dn: CN=Test1,OU=Staff,DC=domain,DC=net
changetype: add
cn: Test1
givenName: Test1
objectClass: user <--------------------------------|
sAMAccountName: Test1 <----------------------------|
                                                   |
How can you import a file to fill in those fields? |
Avatar of hadame

ASKER

Thanks Housenet.  I have another question for you. Keep checking...