Solved

Moving user to an OU from the command line

Posted on 2004-08-18
6
1,442 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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks fo your response

but how can i get a copy of dsmove.exe or movehere.exe?
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 57

Expert Comment

by:Pete Long
Comment Utility
>> 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
Comment Utility
You should find dsmove in %SystemRoot%\System32
0
 

Expert Comment

by:morriskd82
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
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…

744 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

16 Experts available now in Live!

Get 1:1 Help Now