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
336 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
[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
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
This article demonstrates probably the easiest way to configure domain-wide tier isolation within Active Directory. If you do not know tier isolation read https://technet.microsoft.com/en-us/windows-server-docs/security/securing-privileged-access/s…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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 …

739 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