Solved

Moving user to an OU from the command line

Posted on 2004-08-18
6
1,496 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
[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
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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

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 article shows the method of using the Resultant Set of Policy Tool to locate Group Policy that applies a particular setting.
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 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 …

707 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