If you are using Microsoft Deployment Tools you may be looking for a way to rename the administrator account, here I will show how to rename for a Standard Client Task Sequence and a Sysprep And Capture Task Sequence.

Standard Client Task Sequence:

Simply add a command line calling WMIC to rename the account at the end of the Task Sequence.

Open up your task sequence and find  the Eject CD task. Create a custom task of type ‘Run Command Line’ and enter the below command:

wmic useraccount where name=’Administrator’ call rename name=’whateveryouwant

One drawback of this way is that you will be renaming the account your already logged into. To get around potential problems (you will notice opening explorer will complain) I just use FinishAction=RESTART within my custom settings.ini. Not the classiest, but it works for me and might for you. I really couldn’t think up of a more clever way because of how MDT needs to log into the account itself (the autologin settings could be switched but its just all the more hassle).

Sysprep and Capture

A little bit easier and a bit more sound, though it took a tad longer to figure this out.

  1. Create an application, set it to be hidden from the deployment wizard. Within the Sysprep And Capture Task Sequence (at the very end) add an Install Application Task and set it to this new application
  2. Create the batch/script file you linked to from #1. You need to do two things with this batch file:

    1.Create %windir%\Setup\Scripts directory
    2.Copy the SetupComplete.cmd to that directory

  3. Within the application folder, create SetupComplete.cmd. Populate it with the following:
    net user administrator /active:yes
    wmic useraccount where name=’Administrator’ call rename name=’whateveryouwant

That’s it. SetupComplete.cmd will run automatically upon initialization of the prepped image. My ears are open to any better techniques!

No Comments

There are no comments related to this article.