Solved

how to add a user to active directory from command line, also specifying the password and the email address

Posted on 2008-10-09
8
331 Views
Last Modified: 2012-05-05
i want to add users to active directory from command line, i must be able to

(1) create the user
(2) specify which active directory security group the user should be added to
(3) include the email address of the user

i have admin access to the active directory, not sure what else is needed to create the user.

please help me understand what is  the meaning of "DC" and "OU" and how and where to find this information on the server. i am sure this information is used while creating the user.
0
Comment
Question by:tarcot
  • 5
  • 3
8 Comments
 
LVL 70

Expert Comment

by:KCTS
ID: 22683713
You can create users with a variety of tools such as CSDVE, LDIFDE, VBSCRIPT or (with 2003/8 the DSadd commands) see http://www.computerperformance.co.uk/Logon/DSadd_add_user.htm

but why - I would help to know exactly what you are trying to achieve.
0
 

Author Comment

by:tarcot
ID: 22683762
i am specifically interested with the dsadd command, we get a nightly feed of users that are needed to be added to the domain, we use sharepoint, so the next day these users automatically get authenticated when they login.

i am not sure i should  add it in the wss_ou, we are talking about 120,000 users that need to be created.
although creation of these users is a one time thing, there will be 100's of users each day that need to be either added or deleted..

we have a dedicated active directory server to handle this volume.

also in the link that you have sent it does not indicate how  to assign the user to a group, is there a seperate command that i could use to assign user to a group..?



0
 
LVL 70

Expert Comment

by:KCTS
ID: 22683784
OK, I see where you are coming from. Theres a lot more on the DS commands (DSadd, DSMod and DSrm) at http://www.computerperformance.co.uk/Logon/DSadd_add_user.htm

As you have so many users to manage in this way, it probably worth looking at third party tools
eg http://manageengine.adventnet.com/products/ad-manager/active_directory_bulk_user_management.html
and
http://www.dovestones.com/products/Active_Directory_User_Import_Features.asp
0
 

Author Comment

by:tarcot
ID: 22683826
thanks for the resources, i will definetly consider looking more deeply into it

i did see an entry in the third link that you sent

Group memberOf "CN=ManagersGroup,DC=Domain,DC=Com"

can we use the above syntax with the dsadd command in any way. i believe this is the only thing that is missing.
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 70

Accepted Solution

by:
KCTS earned 500 total points
ID: 22683846
you can use the -memberOf option
see http://forums.techarena.in/active-directory/704257.htm for an example
0
 

Author Comment

by:tarcot
ID: 22683892
please apologize my ignorance, i am not sure i have understood completly what this means

DSadd user "CN=Last\, First,OU=AB,DC=Xyxyxyx,DC=Com" -pwd Password -samid
First.last -fn First -ln Last -empid 12345 -display "Last, First" -loscr
Script.vbs -upn First.Last@Xyxyxyx.com -memberof "CN=.Abc
Def,OU=AB,DC=Xyxyxyx,DC=com"

please explain
(1) what is -loscr Script.vbs
(2) what is -upn (looking at the example above it looks like an email address for the user)
(3) -pwd, -fn, -ln,  -empid,-display  seem to be various attributes that can be specifed while user creation - am i right..?
(4) i assume that abcbef is the name of the AD security group -- is my understanding correct
0
 

Author Comment

by:tarcot
ID: 22684032
i tried the example on the server and got the following error

dsadd user "CN=mytest.user,OU=wss_ou,dc
=s265601-ad01,dc=corp" -pwd Dummy123 -upn a@b.com -memberof
 "cn=Broker,ou=wss_ou,dc=s265601-ad01,dc=corp"
dsadd failed:CN=mytest.user,OU=wss_ou,dc=s265601-ad01,dc=corp:Directory objec
t not found.:The object was created successfully but there was an error during p
ost create operations.
type dsadd /? for help.

my ou name is wss_ou which i just created using the following command
dsadd ou "ou=wss_ou, dc=s265601-ad01,dc=corp"

not sure if there is something else i should do...?
0
 

Author Closing Comment

by:tarcot
ID: 31504895
it worked
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

Suggested Solutions

I'm sure that every Windows systems administrator has written, or at least used, a batch or VBS login script at some point in their career, whether it is to map network drives, install printers, or set some user preferences.  No more! With Window…
Mapping Drives using Group policy preferences Are you still using old scripts to map your network drives if so this article will show you how to get away for old scripts and move toward Group Policy Preference for mapping them. First things f…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

911 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

22 Experts available now in Live!

Get 1:1 Help Now