Solved

CREATEUSERS.VBS SCRIPT FOR ACTIVE DIRECTORY

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

746 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

13 Experts available now in Live!

Get 1:1 Help Now