Solved

Moving user to an OU from the command line

Posted on 2004-08-18
6
1,479 Views
Last Modified: 2008-05-30
Hi,
I am using windows 2000 server and I will be creating a lot of users and after creating the users I will have to put them in different OU's.  

How can I use the command line of windows 2000 to move a user from the default users group to a particular OU?

If there is a file to do this, where can I get a download of that particular file?

I use the net user command to create user (it is over 7000 users and they have about 7 different OU's) , so I know if I created them from active directory I could press the right button choose move then select the OU, but I am not using the AD method.  I hope you understand and can help me.

Thanks in advance.
0
Comment
Question by:rwhittle
6 Comments
 
LVL 15

Accepted Solution

by:
scampgb earned 150 total points
ID: 11829929
Hi rwhittle,

You can use a program called "dsmove" to do this.

The article http://www.winnetmag.com/Article/ArticleID/40556/40556.html explains how

Enjoy!
0
 
LVL 57

Expert Comment

by:Pete Long
ID: 11830162
you allrady have the tools, syntax is here

Moving a user account to a different container within the same domain
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/scriptcenter/scrguide/sas_usr_aznz.asp

Moving a user account to a different container within the same domain

Listing 7.18 contains a script that moves a user account from one OU to another OU within the same domain. To carry out this task, the script performs the following steps:

1.
 Bind to the target OU by using the GetObject function and the LDAP provider.
 
2.
 Use the MoveHere method of IADsContainer to move the user account from the HR OU to the Sales OU.
 


 Set objOU = GetObject("LDAP://ou=Sales,dc=NA,dc=fabrikam,dc=com")

objOU.MoveHere _
 "LDAP://cn=BarrAdam,ou=HR,dc=NA,dc=fabrikam,dc=com", "cn=barradam"

 
0
 

Author Comment

by:rwhittle
ID: 11830283
Thanks fo your response

but how can i get a copy of dsmove.exe or movehere.exe?
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 57

Expert Comment

by:Pete Long
ID: 11830470
>> movehere.exe?

you allready have it its pers of the server WMI interface

substitute your details for the example above bang it all in a notepad file

save it as move.vbs and then run it
0
 
LVL 15

Expert Comment

by:scampgb
ID: 11831918
You should find dsmove in %SystemRoot%\System32
0
 

Expert Comment

by:morriskd82
ID: 11832356
DSMove is a part of directory services command line tools...  You don't have to script it's use... You can also use from a command line...

Here's further explanation:

http://www.microsoft.com/windowsxp/home/using/productdoc/en/default.asp?url=/windowsxp/home/using/productdoc/en/ds_command_line_tools.asp

0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Last week, our Skyport webinar on “How to secure your Active Directory” (https://www.experts-exchange.com/videos/5810/Webinar-Is-Your-Active-Directory-as-Secure-as-You-Think.html?cid=Gene_Skyport) provided 218 attendees with a step-by-step guide for…
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
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 from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…

733 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