MoveUser for Vista and Windows 7


  • Download the Vista/Windows 7 MoveUser script HERE.

The MoveUser.exe utility was an invaluable tool for migrating local user profiles on a Windows XP machine to a Domain based login. (Or even moving a user from one Domain to another.) However, that utitlity does not work with Windows Vista. Microsoft initially posted that you could duplicate the same functionality using VBScript, but they had really horrible explanations about just how to go about that. Then, on the Technet site, Rob Greene posted a really good sample script that worked. (His original blog post was available Here.) I took the method that he was finally able to demonstrate and I incorporated the ability to use command line variables and make the script as close to the previous utility as I could get it. The script only runs on Vista SP1 and higher. It would be nice if there could be one tool for both XP and Vista, but I don't see that being possible with a simple VBScript. - I've added an OS check routine so that if you run the script on XP or Vista without SP1 you will get a message informing you that the script cannot continue. (Previously, you would have just gotten an error that told you nothing about why if failed.)

Here are the instructions for using the script...


There is one variable that must be edited before running the script. On line #28 you will find a line that reads: strDomainDN="dc=contoso,dc=com".
It is shown here set up for Microsoft's generic Contoso.com. Change it to work with your domain.
(For those asking about what editor I'm using there, it is PSPad.)

After making that one change, you are ready to go.
Log in to the computer using a user that has local administrator rights, and one that isn't the user you are moving from or too. (The profile won't move if it is in use.)

If you run the script by simply double-clicking it, you will see the syntax examples.


You will need to run the script from a command prompt - and you will need to launch the command prompt as "Administrator".
So, click on "Start -> All Programs -> Accessories" - then right-click on the "Command Prompt" icon and choose "Run as administrator".

Change to the directory where you have the script file, and run the script with the appropriate user names.

If the user exists, you will then be prompted to complete the move.
Answer Yes and the profile gets moved; Answer No and the script terminates.

By default, if the source user is a local account (and it is not "Administrator"), it gets deleted once the profile is moved to the domain user account.
If you do not want this to happen, you must specify the "/k" option. (This is the same behavior as the original Moveuser.exe)




==Ron Williams