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 no longer worked 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. - 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)


 

You can make things finish faster if you do some preperation before running the script.

First, clear out the Temporary Internet Files cache. The script will have to assign permissions to all files in the profile folder. Having a large cache folder will take a very long time to process.

Also, moving any large folders, (folders with lots of files...), out of the profile and to a root folder on the hard drive will similarly speed up the process.

What I eventually ended up doing was creating a new Migration folder at the root level and move everything from the users My Documents folder into there before running the script. If the user had a lot of stuff stored on their desktop, I would move that, too. Then, after the script was finished, I would have the user log in with their Domain account and we would move their files back where they belong.



==Ron Williams