/build/static/layout/Breadcrumb_cap_w.png

How do I add a custom local administrator account through sysprep?

I am using the K1000 box to deploy windows 7 enterprise images to a range of desktops and laptops. I have used the audit mode to configure the master image machine with software and settings.  I've attached an unattend.xml file to the sysprep folder and run the sysprep.exe /generalize /oobe /shutdown /unattend:unattend.xml command.  Once it shuts down, I pxe boot it and capture the image to the server.

The problem I run into is when I deploy the image and the machine boots up it asks for the computer name like I want it to, but it also asks for an administrator username and password.  This causes a problem because when it restarts and I go to log in the KACE post-install tasks do not run.  I've added an admin user to the OOBE pass of the unattend.xml file but this does not seem to fix the problem.  I am trying to automate the imaging process as much as possible and need those postinstall tasks to run.  I've pasted my unattend.xml file below with the sensitive data taken out.  Thanks for any and all help.

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="generalize">
        <component name="Microsoft-Windows-Security-SPP" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <SkipRearm>1</SkipRearm>
        </component>
    </settings>
    <settings pass="specialize">
        <component name="Microsoft-Windows-Deployment" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <RunSynchronous>
                <RunSynchronousCommand wcm:action="add">
                    <Order>1</Order>
                    <Path>net user administrator /active:yes</Path>
                </RunSynchronousCommand>
            </RunSynchronous>
        </component>
        <component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <SkipAutoActivation>true</SkipAutoActivation>
        </component>
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <CopyProfile>true</CopyProfile>
            <ShowWindowsLive>false</ShowWindowsLive>
            <TimeZone>Central Standard Time</TimeZone>
        </component>
    </settings>
    <settings pass="oobeSystem">
        <component name="Microsoft-Windows-International-Core" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <InputLocale>en-us</InputLocale>
            <SystemLocale>en-us</SystemLocale>
            <UILanguage>en-us</UILanguage>
            <UserLocale>en-us</UserLocale>
        </component>
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <FirstLogonCommands>
                <SynchronousCommand wcm:action="add">
                    <CommandLine>cscript //b c:\windows\system32\slmgr.vbs /ipk (our KMS product Key)</CommandLine>
                    <Order>1</Order>
                    <RequiresUserInput>false</RequiresUserInput>
                </SynchronousCommand>
                <SynchronousCommand wcm:action="add">
                    <CommandLine>cscript //b c:\windows\system32\slmgr.vbs /ato</CommandLine>
                    <Order>2</Order>
                    <RequiresUserInput>false</RequiresUserInput>
                </SynchronousCommand>
            </FirstLogonCommands>
            <OOBE>
                <HideEULAPage>true</HideEULAPage>
                <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
                <NetworkLocation>Work</NetworkLocation>
                <ProtectYourPC>1</ProtectYourPC>
            </OOBE>
            <UserAccounts>
                <AdministratorPassword>
                    <Value>(Our admin password)</Value>
                    <PlainText>false</PlainText>
                </AdministratorPassword>
                <LocalAccounts>
                    <LocalAccount wcm:action="add">
                        <Password>
                            <Value>(our local admin password)</Value>
                            <PlainText>false</PlainText>
                        </Password>
                        <DisplayName>(local admin username)</DisplayName>
                        <Group>Administrators</Group>
                        <Name>dtech</Name>
                    </LocalAccount>
                </LocalAccounts>
            </UserAccounts>
            <RegisteredOrganization>School District of New Berlin</RegisteredOrganization>
            <RegisteredOwner>SDNB</RegisteredOwner>
        </component>
    </settings>
    <cpi:offlineImage cpi:source="catalog:d:/sources/install_windows 7 enterprise.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

0 Comments   [ + ] Show comments

Answers (2)

Answer Summary:
Add an section. http://technet.microsoft.com/en-us/library/cc766283(v=WS.10).aspx
Posted by: philologist 12 years ago
Red Belt
4

Take a look at adding an <AutoLogon> section.   http://technet.microsoft.com/en-us/library/cc766283(v=WS.10).aspx

 

 


Comments:
  • Of note, if you are using an older version of the K2K, you had to tell it you were doing a sysprep deployment. - philologist 12 years ago
  • I'm using the latest updates of the K2K. I'm trying the autologon suggestion now. - sdnbtech1 12 years ago
  • Let us know if that solves the issue. I know I had to fight with unattend.xml for a while, but the good part is that once it is done, it is done. - philologist 12 years ago
  • After monkeying around with it, the AutoLogon was the problem. Thank you Philogist. - sdnbtech1 12 years ago
  • Glad we could help! - philologist 12 years ago
Posted by: SMal.tmcc 12 years ago
Red Belt
2

I have ran into  that problem when the user you want to add in the unattend xml file already existed on the machine being repackaged.  I deleted that user prior to syspreping and it worked fine.

your script looks good, this is that part of mine.

<UserAccounts>
                <LocalAccounts>
                    <LocalAccount wcm:action="add">
                        <Password>
                            <PlainText>false</PlainText>
                            <Value>xxxxxxxxxx</Value>
                        </Password>
                        <DisplayName>F12Master</DisplayName>
                        <Name>F12Master</Name>
                        <Group>Administrators</Group>
                    </LocalAccount>
                </LocalAccounts>
                <AdministratorPassword>
                    <PlainText>false</PlainText>
                    <Value>xxxxxxxxxx</Value>
                </AdministratorPassword>
            </UserAccounts>


Comments:
  • Oddly enough, if the account was on the machine already, I didn't have any problems. That is why I didn't know I had an issue for a while. Thanks for the coding snippet SMal.tmcc - sdnbtech1 12 years ago

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ