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?

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

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>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.