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
332 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
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 

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
 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Resolve DNS query failed errors for Exchange
This article outlines the process to identify and resolve account lockout in an Active Directory environment.
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 from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

776 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