Windows 10 SysPrep not working



  • Re: Windows 10 1703 Image with strange issue

    I have taken advice from all over the Internet, and I’m failing every time after the SysPrep has completed. I want to create an image (generic or specific to the hardware) with Windows 10, Office 2016, browsers and our regular applications. Part of what I want to do is also duplicate the Start Menu layout, but nothing is working.

    The latest attempts will capture the image, then a message comes up on the same computer I built the image on saying "Windows could not finish configuring the system. To attempt to resume configuration, restart the computer.". I can click OK many times, and the computer just restarts and does the same thing.

    My unattend.xml file is here:

    <?xml version="1.0" encoding="utf-8"?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
        <settings pass="auditSystem">
            <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <AuditComputerName>
                    <Name>JMC-X-AUDIT</Name>
                </AuditComputerName>
            </component>
            <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <UserAccounts>
                    <AdministratorPassword>
                        <Value>REDACTED</Value>
                        <PlainText>false</PlainText>
                    </AdministratorPassword>
                </UserAccounts>
            </component>
        </settings>
        <settings pass="oobeSystem">
            <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" 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-CA</UILanguage>
                <UILanguageFallback>en-US</UILanguageFallback>
                <UserLocale>en-US</UserLocale>
            </component>
            <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <DesktopOptimization>
                    <GoToDesktopOnSignIn>true</GoToDesktopOnSignIn>
                    <ShowWindowsStoreAppsOnTaskbar>true</ShowWindowsStoreAppsOnTaskbar>
                </DesktopOptimization>
                <OEMInformation>
                    <SupportURL>https://jmc.sd57.bc.ca/~lbarone</SupportURL>
                </OEMInformation>
                <OOBE>
                    <HideEULAPage>true</HideEULAPage>
                    <HideLocalAccountScreen>true</HideLocalAccountScreen>
                    <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
                    <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
                    <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
                    <ProtectYourPC>1</ProtectYourPC>
                </OOBE>
                <WindowsFeatures>
                    <ShowInternetExplorer>true</ShowInternetExplorer>
                </WindowsFeatures>
                <UserAccounts>
                    <AdministratorPassword>
                        <Value>REDACTED</Value>
                        <PlainText>false</PlainText>
                    </AdministratorPassword>
                </UserAccounts>
                <FirstLogonCommands>
                    <SynchronousCommand wcm:action="add">
                        <CommandLine>C:\Windows\Setup\Scripts\SetupComplete.cmd</CommandLine>
                        <Description>Run SetupComplete.cmd batch file</Description>
                        <Order>1</Order>
                    </SynchronousCommand>
                </FirstLogonCommands>
            </component>
            <component name="Microsoft-Windows-WiFiNetworkManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <DefaultAutoConnectOpenState>0</DefaultAutoConnectOpenState>
                <DefaultAutoConnectSharedState>0</DefaultAutoConnectSharedState>
                <WiFiSenseAllowed>0</WiFiSenseAllowed>
                <WiFiSharingFacebookInitial>0</WiFiSharingFacebookInitial>
                <WiFiSharingOutlookInitial>0</WiFiSharingOutlookInitial>
                <WiFiSharingSkypeInitial>0</WiFiSharingSkypeInitial>
            </component>
            <component name="Microsoft-Windows-WinRE-RecoveryAgent" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <UninstallWindowsRE>true</UninstallWindowsRE>
            </component>
        </settings>
        <settings pass="specialize">
            <component name="Microsoft-Windows-IE-InternetExplorer" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <StartPages>
                    <StartPage wcm:action="add">
                        <StartPageKey>1</StartPageKey>
                        <StartPageUrl>https://www.sd57.bc.ca/school/cla/Pages/default.aspx</StartPageUrl>
                    </StartPage>
                </StartPages>
                <SuggestedSitesEnabled>false</SuggestedSitesEnabled>
                <Home_Page>https://www.sd57.bc.ca/school/cla/Pages/default.aspx</Home_Page>
                <DisableOOBAccelerators>true</DisableOOBAccelerators>
                <DisableFirstRunWizard>true</DisableFirstRunWizard>
                <DisableAccelerators>true</DisableAccelerators>
                <CompanyName>School District #57 (Prince George)</CompanyName>
            </component>
            <component name="Microsoft-Windows-WwanUI" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <NotInOOBE>true</NotInOOBE>
            </component>
            <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" 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>
            </component>
        </settings>
        <settings pass="generalize">
            <component name="Microsoft-Windows-SharedAccess" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <EnableICS>false</EnableICS>
            </component>
        </settings>
        <cpi:offlineImage cpi:source="wim://tech-lbarone/users/luke/desktop/win10x64pro_workingdir/sources/install.wim#Windows 10 Pro Technical Preview" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
    </unattend>
    

    The latest take was done in Hyper-V, with the recommendation to make base images in a virtualized environment. Next step will be to figure out how to get it to work with FOG’s PXE boot mode, but that’s later.

    Steps to reproduce:

    1. Use our Volume License media to install Windows 10, wiping the hard drive and letting Windows partition as necessary
    2. Go into Audit mode during Cortana setup screen
    3. Install Office 2016, AVG Anti-virus (disabled during testing and setup), Chrome / Firefox, Adobe Reader
    4. Apply Local Group Policy (no Active Directory domain setup)
    5. Install the FOG client from my FOG installation (Running Version 1.3.4, SVN Revision: 6064). Service is disabled in services.msc
    6. Customize the Admin profile (i.e. desktop icons, Start Menu, background picture, etc)
    7. Restart system (still in Audit), verify everything looks good. Copy SetupComplete.cmd, Layout.ps1, and our Wireless profile file to C:\Windows\Setup\Scripts. Copy the unattend.xml file to C:\Windows\System32\SysPrep
    8. Restart one more time for good measure.
    9. Run sysprep /quiet /generalize /oobe /shutdown /unattend:unattend.xml from the Command Prompt, in the C:\Windows\System32\SysPrep working folder
    10. Attempt to capture image
    11. System turns back on, and the error message appears.

    Below is my SetupComplete.cmd file:

    sc config FOGService start= auto
    net start FOGService
    echo Installing Windows Product Key...
    cscript //b c:\windows\system32\slmgr.vbs /ipk REDACTED
    echo Activating Windows....
    cscript //b c:\windows\system32\slmgr.vbs /ato
    netsh wlan add profile filename=Private-SD57-2.xml user=all
    Powershell.exe -NoProfile -Command "& {Start-Process PowerShell.exe -ArgumentList '-NoProfile -ExecutionPolicy ByPass -File ""%~dp0\layout.ps1""' -Verb RunAs}"
    rd /S /Q "C:\Users\Default\AppData\LocalLow"
    rd /S /Q "C:\users\Default\AppData\Local\Microsoft\Windows\WebCache"
    rd /S /Q "C:\Users\Default\AppData\Local\Microsoft\Windows\INetCache"
    del /F "C:\Users\Default\AppData\Local\Microsoft\Windows\WebCacheLock.dat"
    REM del /F C:\Windows\System32\Sysprep\unattend.xml
    REM del /F C:\Windows\Setup\Scripts\SetupComplete.cmd
    REM del /F C:\Windows\Setup\Scripts\Private-SD57-2.xml
    del /F c:\windows\system32\sysprep\panther\setupact.log
    del /F c:\windows\system32\sysprep\panther\setuperr.log
    del /F c:\windows\system32\sysprep\panther\ie\setupact.log
    del /F c:\windows\system32\sysprep\panther\ie\setuperr.log
    shutdown -r -t 60 -f
    

    Where can I go to troubleshoot further?



  • @lukebarone said in Windows 10 SysPrep not working:

    @loosus456 Yea, I have no objection to that. But I can’t get the Taskbar Customization to work (even after fixing the .xml file that is generated), so I gave that part up. It resets the taskbar to just Edge and Explorer, and allows users to customize it how they wish.

    Hi,

    you need to apply taskbar customs via group policy, if so the user has change rights:

    https://social.technet.microsoft.com/Forums/windows/en-US/83b725f4-90f8-476a-bba0-3193e4e47d2e/windows-10-1607-enterprise-taskbar-items-pinned-via-layoutmodificationxml-and?forum=win10itprosetup

    IMPORTANT

    If you use a provisioning package to configure the taskbar, your configuration will be reapplied each time the explorer.exe >process restarts. If your configuration pins an app and the user unpins that app, the user’s change will be overwritten the >next time the configuration is applied. To apply a taskbar configuration and allow users to make changes that will >persist, apply your configuration by using Group Policy.

    https://technet.microsoft.com/en-us/itpro/windows/manage/configure-windows-10-taskbar?f=255&MSPPError=-2147217396

    What ever can be done by gpo should be done with gpo (ms philosopy). If you don’t have a domain controller for gpo applyment you can simply use gpedit.msc locally to set this on your golden image.

    Regards X23



  • @lukebarone It works fine for me, but I just don’t use it since users can’t then change their taskbar.



  • @loosus456 Yea, I have no objection to that. But I can’t get the Taskbar Customization to work (even after fixing the .xml file that is generated), so I gave that part up. It resets the taskbar to just Edge and Explorer, and allows users to customize it how they wish.



  • @knightraven The problem with using taskbar customization in the XML file is that users cannot make permanent changes to the taskbar. It resets any changes the user makes after reboot.



  • @quazz I remember in previous images, FOG would resize the images before capturing, then expand them during deployment. For whatever reason, it was not doing that this time around. As per my new post, upgrading to 1.4.4 may have helped… Or just a coincidence…


  • Moderator

    @lukebarone The postdownloadscripts were likely unable to do anything if your drive was full.



  • OK, I booted the install drive I had for Windows, and loaded up diskpart. Apparently, the C: only had 29GB total, with nothing free! It also looked like my postdownloadscripts did not load, as the drivers didn’t appear in the Windows folder automatically.

    The new user profile loads, and the Start Menu is working - taskbar, not so much.

    So my new issue (which I’ll open a new thread) is to figure out why FOG isn’t resizing the C: automatically like it did with Windows 7, and why the postdownloadscripts are not working.



  • So I thought it was successful, but apparently not. On my base image machine, I exported the Start Layout into the root of C:, as an XML (apparently, the -As BIN function is removed in Windows 10), and pointed the GPO at that. I rebooted the base image machine, and the start menu was locked down, and the taskbar looked perfect! I even went as far as dropping the unattend.xml file into the %WINDIR%\Panther folder instead.

    The issue now when deploying is that when I log in as the user that I had the answer file create, I get the cryptic error message The User Profile Service service failed the sign in. User profile cannot be found. I am skipping the User OOBE so that I can just get in with the Administrator account… But the Administrator account is not active for some reason. I cannot log in via Safe Mode (or else I don’t know how to get into it with Windows 10 without being able to log in), so I cannot pull the logs. I’ll probably be spending my morning trying to get the logs though.

    Thoughts?


  • Moderator

    defprof is an excellent alternative for setting up the default profile.

    I gave up on unattend files for Windows 10, personally, more headaches than its worth, but then my use cases tend to be simple enough.



  • @lukebarone
    Oh apparently its just a little further up the chain…
    Using the same xml file you can customize both.
    https://docs.microsoft.com/en-us/windows/configuration/configure-windows-10-taskbar

    Jason



  • @lukebarone
    I feel your pain. Win 10 just doesn’t play well with the old conventions of sysprepping it seems.
    For the start menu, however, the closest I can see is to use a GPO and export the layout.
    Try this site for details: Win 10 Customize and export Start layout
    I’m not sure yet if there is a clean way to do the taskbar. We used a script that setup the links/pins for Win7. I havent tested yet if it work the same for 10.

    just my $.02 worth. Hope it helps some.
    Jason



  • @george1421 So apparently, it worked this time for Sysprepping. No errors came up on my Hyper-V after the capture job was done.

    Next is figuring out how to duplicate the Start Layout and Taskbar for every user… Which, as I failed to mention, was the original main show-stopper for me.


  • Moderator

    Just so we have the terminology right. Sysprep is working and you can capture the image, right? Where its actually failing is once the system is cloned (or rebooted) and during OOBE you get the message "Windows could not finish configuring the system. To attempt to resume configuration, restart the computer." Do I understand that correct?

    If that is the case there are log files on the target computer you need to review. They are in c:/Windows/Panther or in c:/Windows/Setup/Sysprep I would look in panther first. They will end with .log one of the log files will tell you what happened. Its been about a year since I went through some similar debugging.

    So how do you get to the files, at the error message… I believe you hit F3 or shift-F10 (sorry doing from very crusty memory) to call up a command window. From there you can then launch notepad.exe and navigate to the log files to review.

    -OR-
    Remove the failed image hard drive from the computer and add as a second hard drive in another computer.

    In my case I was able to find the error was I was defining a location for the unattend.xml file when sysprep was called, but the file was not in that location so when OOBE ran it died.

    [Edit] Also after looking at your post again, I would suggest that you put your unattend.xml file in the Panther directory and not sysprep.


 

319
Online

41.6k
Users

12.1k
Topics

114.4k
Posts