Windows Scripting
  Home arrow Windows Scripting arrow Page 2 - Moving and Renaming Computers with Active ...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
Moblin 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
IBM developerWorks
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WINDOWS SCRIPTING

Moving and Renaming Computers with Active Directory
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2008-01-17

    Table of Contents:
  • Moving and Renaming Computers with Active Directory
  • Moving a Computer to a New Domain
  • Renaming a Computer
  • Add or Remove a Computer Account from a Group

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Moving and Renaming Computers with Active Directory - Moving a Computer to a New Domain


    (Page 2 of 4 )

    Problem

    You want to move a computer object to a different domain. 

    Solution

    Using a graphical user interface

    To migrate a computer object between domains in the same forest, use the following steps:

    1. Open the ADMT MMC snap-in.
    2. Right-click on the Active Directory Migration Tool folder and select the Computer Account Migration Wizard.
    3. On the Domain Selection page, enter the DNS or NetBIOS name of the source and target domains. Click Next.
    4. On the Translate Objects screen, specify which objects should have new ACLs applied in the new domain. Select any, none, or all of the following, and then click Next to continue:
      • Files and folders
      •  Local groups
      •  Printers
      •  Registry
      •  Shares
      •  User profiles
      •  User rights
    5. On the Security Migration Options screen, select the following options to determine how local user accounts will be migrated into the new domain. Select one of the following and click Next to continue:

      Replace
         This option will replace any references to
         objects from the source domain with
         references to objects in the target domain.

      Add
         This option adds references to objects in the
         target domain while leaving the source domain
         objects intact.

      Remove
         This option removes all references to source
         domain objects.
    6. On the Naming Conflicts page, configure how the wizard should handle naming conflicts during the migration process. Select one of the following and click Next to continue:

      • Ignore conflicting accounts and don’t migrate.
      • Replace conflicting accounts.
      • Rename conflicting accounts by adding a designated prefix or suffix.
    7. On the Options screen, select the amount of time the wizard should wait before rebooting the target computer into the new domain.
    8. Click Next to review your choices and begin the migration process.

    Using a command-line interface

    The following command will migrate a computer object from the rallencorp.com domain to the emea.rallencorp.com domain. It will place the migrated object in the Finance OU and will wait two minutes before rebooting the target computer:

      ADMT COMPUTER /N "FIN101-A" "FIN101-A" /SD:"emea.rallencorp.com" 
      /TD:"emea.rallencorp.com" /TO:"Finance" /RDL:2

    Using VBScript

      set objObject = GetObject(LDAP://TargetDC/TargetParentDN)
      objObject.MoveHere "LDAP://SourceDC/SourceDN", vbNullString

    Discussion

    You can move objects between domains assuming you follow a few guidelines:

    1. The user requesting the move must have permission to modify objects in the parent container of both domains.
    2. You need to explicitly specify the target DC (serverless binds usually do not work). This is necessary because the Cross Domain Move LDAP control is being used behind the scenes. (For more information on controls, see Recipe 4.4.)
    3. The move operation must be performed against the RID master for both domains. This is done to ensure that two objects that are being moved simultaneously don’t somehow get assigned the same RID.
    4. Both domains must be in native mode.

    See Also

    Recipe 4.4 for more on LDAP controls, MSDN: IADsContainer::MoveHere, and MS KB 326480 (How to Use Active Directory Migration Tool version 2 to migrate from Windows 2000 to Windows Server 2003)

    More Windows Scripting Articles
    More By O'Reilly Media


       · This article is an excerpt from the book "Active Directory Cookbook, Second...
     

    Buy this book now. This article is excerpted from chapter eight of the Active Directory Cookbook, Second Edition, written by Robbie Allen and Laura E. Hunter (O'Reilly; ISBN: 059610202X). Check it out today at your favorite bookstore. Buy this book now.

    WINDOWS SCRIPTING ARTICLES

    - Understanding Procedures in VBScript
    - Printing Documents in WSH
    - Generating Outlook Signatures Based on Activ...
    - VBScript: Converting and Formatting with Fun...
    - VBScript: Conversion and Format Functions
    - VBScript: Array Functions
    - VBScript: Strings, You Can`t Function withou...
    - VBScript: More String Functions
    - VBScript: Functioning with Strings
    - Working with the Windows Registry in C++
    - Understanding Objects
    - HTML Applications: Giving WSH a User Interfa...
    - Modifying Computer Objects with Active Direc...
    - Logon Script to Send Email Notifications
    - Securing Computers and Active Directory




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway