Solved

Moving user to an OU from the command line

Posted on 2004-08-18
6
1,451 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
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.

 
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

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.

Question has a verified solution.

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

In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
Synchronize a new Active Directory domain with an existing Office 365 tenant
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 is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

896 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

15 Experts available now in Live!

Get 1:1 Help Now