Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

CREATEUSERS.VBS SCRIPT FOR ACTIVE DIRECTORY

Posted on 2001-07-11
5
Medium Priority
?
487 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 200 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

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…
A walk-through example of how to obtain and apply new DID phone numbers to your cloud PBX enabled users that are configured in Office 365. Whether you have 1, 10 or 100+ users in your tenant, it's quite easy to get them phone-enabled and making/rece…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

636 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