Solved

CREATEUSERS.VBS SCRIPT FOR ACTIVE DIRECTORY

Posted on 2001-07-11
5
479 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Outlook 2013 Certicate error 1 297
Terminal 2000 connection RDP 5 140
Migrating from IIS5 to IIS8.5 3 178
Issues after demoting a BDC in preparation of promoting a newer server 11 118
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…
The business world is becoming increasingly integrated with tech. It’s not just for a select few anymore — but what about if you have a small business? It may be easier than you think to integrate technology into your small business, and it’s likely…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

830 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