Solved

CREATEUSERS.VBS SCRIPT FOR ACTIVE DIRECTORY

Posted on 2001-07-11
5
475 Views
Last Modified: 2007-11-27
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?
0
Comment
Question by:hadame
  • 3
  • 2
5 Comments
 
LVL 12

Expert Comment

by:Housenet
ID: 6275377
-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
0
 

Author Comment

by:hadame
ID: 6277873
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?

0
 
LVL 12

Accepted Solution

by:
Housenet earned 50 total points
ID: 6277948
-The problem is... OU=users .. Users is a predefined root container name therefore must appear as CN=Users

-Here's an example (from the doc I gave you the link to) of how to import into an OU

dn: CN=Test1,OU=Staff,DC=domain,DC=net
changetype: add
cn: Test1
givenName: Test1
objectClass: user
sAMAccountName: Test1
0
 

Author Comment

by:hadame
ID: 6296063
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? |
0
 

Author Comment

by:hadame
ID: 6314997
Thanks Housenet.  I have another question for you. Keep checking...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
We need a new way to communicate time sensitive or critical info.   The best part of my role at xMatters is visiting our clients all over the world to learn about how they operate their businesses, share insights that xMatters has gleaned across…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now