1

We are deploying Windows 7 using WDS. We want to remove the local user account which was created during setup. We don't need this account since the machines join a domain and a domain user account is created during OOBE phase.

Documentation of Microsoft-Windows-Shell-Setup | UserAccounts | LocalAccounts states that this option can create local accounts.

Is there a way to specify accounts to be deleted in a unattend.xml?

Scolytus
  • 434
  • 3
  • 7
  • 22

2 Answers2

3

You want to use Audit Mode when creating your Sysprep image. Audit Mode enables you to customize a Windows installation without prompting to create user accounts and configure your location and time zone.

Reference: http://technet.microsoft.com/en-us/library/cc722413(v=ws.10).aspx

colealtdelete
  • 6,017
  • 2
  • 30
  • 34
2

Use a cmd file with net user "user name" /delete

part of Unattend.xml:

        <FirstLogonCommands>
            <SynchronousCommand wcm:action="add">
                <Description>Executing lastboot script</Description>
                <Order>1</Order>
                <CommandLine>c:\temp\lastboot.cmd</CommandLine>
            </SynchronousCommand>
            <SynchronousCommand wcm:action="add">
                <Description>logoff corrent user</Description>
                <Order>2</Order>
                <CommandLine>shutdown /l /f</CommandLine>
            </SynchronousCommand>
        </FirstLogonCommands>
sebix
  • 4,313
  • 2
  • 29
  • 47