Problems with CopyProfile

Page 1 of 2 12 LastLast

  1. Posts : 10
    Windows 10 64-bit Education
       #1

    Problems with CopyProfile


    Hi,

    I'm trying to capture and deploy a custom Windows 10 64-bit Education 1903 (build 18362.449) image for a client and, amongst others, have followed some of the brilliant guides on this forum. I've succeeded in building the reference computer and an autounattend.xml file to process a light-tough OOBE - this is all fine.

    I also want to capture settings on the reference computer to the default profile - they are:

    Default apps (mail, PDF & browser)
    Firewall exception to allow ping inbound
    Make the search bar an icon
    Enable remote desktop (secure)
    Put screen to sleep after 1 hour
    Remove desktop icons

    Therefore I'm running the below command on the reference machine at the point of sysprepping it:

    Code:
    c:\windows\system32\sysprep\sysprep.exe /oobe /generalize /shutdown /unattend:C:\Windows\System32\Sysprep\copyprofile.xml
    The file copyprofile.xml was created in Windows AIK and contains the following:

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
        <settings pass="specialize">
            <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>
    			<RegisteredOwner />
            </component>
        </settings>
        <cpi:offlineImage cpi:source="wim:c:/users/robert/desktop/install.wim#windows10_custom" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
    </unattend>
    Unfortunately I'm seeing very mixed results when deploying images with the above.

    I've tried deploying to a machine and applying an autounattend.xml to run through the OOBE and join the computer to the domain - all the answer file settings work fine, but only half of the settings from the image are being retained - the firewall rule, the screen sleep setting and the remote desktop setting.

    I then thought that maybe the domain might be applying some settings which are overriding the image, so I removed the setting to join the domain from the answer file - but this produced the same result as the above, with only 3 settings being retained.

    I finally decided to try sysprepping the reference machine with /reboot instead of /shutdown, to see what would happen if I ran through the OOBE manually, without capturing and deploying it elsewhere. Inexplicably, almost all settings have been retained on this occasion - everything except the default apps, but even they show some evidence of having been changed, then changed back, because the action center throws up 12 errors saying "An app default was reset", and a few saying "The default browser was reset".

    I guess my first question is - why are the app defaults not being retained on the sysprepped reference image? (For the client, this is the most important setting to capture)

    My second question is - why am I losing so many settings when capturing the image (which I know has 5/6 changes committed) and deploying it to another machine? Is there something wrong with my answer file, which might be overwriting things?

    For reference, my answer file can be found here.

    One other question - is there a way, either on the reference image or on the answer file, to force the login screen to ask for username and password every time? The default behaviour is to remember the last login, but the client has users who move from machine to machine frequently and this could be an annoyance.

    Many thanks in advance.

    Regards,
    Robert
      My Computer


  2. Posts : 17,661
    Windows 10 Pro
       #2

    Kidtrebor said:
    I'm trying to capture and deploy a custom Windows 10 64-bit Education 1903 (build 18362.449) image for a client and, amongst others, have followed some of the brilliant guides on this forum. I've succeeded in building the reference computer and an autounattend.xml file to process a light-tough OOBE - this is all fine.

    I also want to capture settings on the reference computer to the default profile.
    Hi Robert, welcome to Ten Forums.

    First, just to be sure this is clear, CopyProfile should only be used when sysprepping Windows in Audit Mode, signed in as built-in admin. Booting to Audit Mode should never be done using any other account. Both local and domain accounts should only be added in answer file, not before running Sysprep.

    Steps to take:
    1. Clean install Windows on reference machine, booting it Audit Mode (boots automatically to built-in admin)
    2. Configure and customize Windows on reference machine
    3. Make all customizations, policy changes and so in Audit Mode when signed in as built-in admin. This is the user profile which CopyProfile will copy to Default Profile
    4. Split your answer file in two parts, settings passes WindowsPE and International-Core-PE in answer file autounattend.xml, and all the rest in unattend.xml (see Parts Three and Four in tutorial: Create media for automated unattended install of Windows 10)
    5. Add CopyProfile to unattend.xml
    6. Generalize with Sysprep using unattend.xml, shutting down the reference machine
    7. Capture the image to a WIM file, use it on install media by replacing original install.wim
    8. Add autounattend.xml to root of the install media, now only containing two passes, WindowsPE and International-Core-PE

    That's about it.


    Kidtrebor said:
    One other question - is there a way, either on the reference image or on the answer file, to force the login screen to ask for username and password every time? The default behaviour is to remember the last login, but the client has users who move from machine to machine frequently and this could be an annoyance.
    See this tutorial, adding the policy when in Audit Mode on reference machine: Do Not Display Last Signed-in User Name on Windows 10 Sign-in

    Kari
      My Computer


  3. Posts : 10
    Windows 10 64-bit Education
    Thread Starter
       #3

    Kari said:
    Hi Robert, welcome to Ten Forums.

    First, just to be sure this is clear, CopyProfile should only be used when sysprepping Windows in Audit Mode, signed in as built-in admin. Booting to Audit Mode should never be done using any other account. Both local and domain accounts should only be added in answer file, not before running Sysprep.

    Steps to take:
    1. Clean install Windows on reference machine, booting it Audit Mode (boots automatically to built-in admin)
    2. Configure and customize Windows on reference machine
    3. Make all customizations, policy changes and so in Audit Mode when signed in as built-in admin. This is the user profile which CopyProfile will copy to Default Profile
    4. Split your answer file in two parts, settings passes WindowsPE and International-Core-PE in answer file autounattend.xml, and all the rest in unattend.xml (see Parts Three and Four in tutorial: Create media for automated unattended install of Windows 10)
    5. Add CopyProfile to unattend.xml
    6. Generalize with Sysprep using unattend.xml, shutting down the reference machine
    7. Capture the image to a WIM file, use it on install media by replacing original install.wim
    8. Add autounattend.xml to root of the install media, now only containing two passes, WindowsPE and International-Core-PE

    That's about it.




    See this tutorial, adding the policy when in Audit Mode on reference machine: Do Not Display Last Signed-in User Name on Windows 10 Sign-in

    Kari
    Hi Kari,

    Thank you so much for this - to confirm, yes I'm doing the above from admin mode. In any case, I've done as you said this morning and it worked first time.

    I must confess, I've been reading your excellent guide linked above and doubted the logic of putting the 'specialise' and 'oobe' settings in the unattend.xml, rather thank the autounattend.xml, since I assumed the settings there had to be read during the OS oobe (rather than during sysprep). Out of interest, can you explain why this works?

    Unfortunately I'm still losing the default apps settings, with lots of errors still popping up in the action centre. Do you know what I'm doing wrong, or is this known to be broken, and I should just give up and specify this through group policy instead?

    Many thanks again.

    Regards,
    Robert
      My Computer


  4. Posts : 17,661
    Windows 10 Pro
       #4

    Kidtrebor said:
    I must confess, I've been reading your excellent guide linked above and doubted the logic of putting the 'specialise' and 'oobe' settings in the unattend.xml, rather thank the autounattend.xml, since I assumed the settings there had to be read during the OS oobe (rather than during sysprep). Out of interest, can you explain why this works?
    There's a fundamental difference in answer file settings applied during Sysprep, and settings applied during boot of custom image. When settings are applied with Sysprep, they are "hard coded" to offline WIM image you will capture. That install.wim then applies the same settings, in whatever install or deployment scenario that image is used.

    Applying settings in autounattend when booting the image applies them to online image, not changing the original WIM image.

    However illogical it sounds, it's better to use two answer files when working with custom Windows image. Apply all OOBE, default profile customization and policy settings using unattend.xml when generalizing the image with Sysprep, and autounattend.xml only to boot target machine, partition it and run Windows Setup.

    I only use one answer file when deploying vanilla, original WIM image without any customizations.


    Kidtrebor said:
    Unfortunately I'm still losing the default apps settings, with lots of errors still popping up in the action centre. Do you know what I'm doing wrong, or is this known to be broken, and I should just give up and specify this through group policy instead?
    Check this Microsoft support article: https://docs.microsoft.com/en-us/win...n-associations

    Under Generate a default app associations XML File, see how to create and export the XML file for default associations. Under Add or Remove Default Application Association Settings to a Windows Image, see how to mount your captured custom WIM image and apply the XML to it.

    Kari
      My Computer


  5. Posts : 10
    Windows 10 64-bit Education
    Thread Starter
       #5

    Kari said:
    There's a fundamental difference in answer file settings applied during Sysprep, and settings applied during boot of custom image. When settings are applied with Sysprep, they are "hard coded" to offline WIM image you will capture. That install.wim then applies the same settings, in whatever install or deployment scenario that image is used.

    Applying settings in autounattend when booting the image applies them to online image, not changing the original WIM image.

    However illogical it sounds, it's better to use two answer files when working with custom Windows image. Apply all OOBE, default profile customization and policy settings using unattend.xml when generalizing the image with Sysprep, and autounattend.xml only to boot target machine, partition it and run Windows Setup.

    I only use one answer file when deploying vanilla, original WIM image without any customizations.




    Check this Microsoft support article: https://docs.microsoft.com/en-us/win...n-associations

    Under Generate a default app associations XML File, see how to create and export the XML file for default associations. Under Add or Remove Default Application Association Settings to a Windows Image, see how to mount your captured custom WIM image and apply the XML to it.

    Kari
    Thank you Kari - I followed the steps from the Microsoft article and it worked perfectly.

    For some reason my settings to pin the Office apps doesn't work - other non-Office apps have pinned, so I'm confident of the config syntax, but to be honest time is getting on a bit so I think I'll give up on that one since all the Office apps are pinned to the Start menu as tiles anyway.

    Thanks again for your amazing help Kari.

    Regards,
    Robert
      My Computer


  6. Posts : 17,661
    Windows 10 Pro
       #6

    Kidtrebor said:
    Thanks again for your amazing help Kari.
    You are welcome!

    Kari
      My Computer


  7. Posts : 10
    Windows 10 64-bit Education
    Thread Starter
       #7

    Hi again - my captured image is more or less working nicely, but I've just deployed it through WDS and lost a few settings - crucially, though, the OS is deploying now to real bare bones computers and, on second deployment, Windows Activation is saying 'Windows reported that the hardware of your device has changed. Error code 0xC004F211'

    I do know that the license key was in the autounattend.xml, so I moved it to unattend.xml to the specialise pass, which is specified to run as the answer file in WDS. This runs, but W10 is still coming out deactivated and with the above error. Maybe the pass I've added it to is wrong?

    I think this error message happens when one doesn't generalise the captured image, and Windows thinks you've taken the HDD out of the chassis and put it in a different computer, but I've definitely sysprepped from audit mode so I don't think this should be happening.

    What have I done wrong?

    Regards,
    Robert

    - - - Updated - - -

    OK, forget it, I know what I did wrong - I applied the wrong autounattend file. I had to remove references to the disk partitioning, as WDS seems to want to force you to do this manually, but once I did it deployed and Windows was activated.

    Strangely, I'm still losing some of the config that's being captured and correctly set when deployed via USB - e.g. deleted desktop icons are back, pinned task bar icons are gone - while others are fine - e.g. default applications, screen sleep.

    I tested the same image via USB this morning and confirmed the deployed image had all the settings intact - in both cases (i.e. WDS & USB) I've tested using the same reference image with almost the same answer file (one with automated disk partitioning and the other without) but getting slightly different results. I don't suppose this description screams an obvious answer to a trained ear, but if it does I'd be grateful for any response.

    Regards,
    Robert
      My Computer


  8. Posts : 17,661
    Windows 10 Pro
       #8

    Kidtrebor said:
    OK, forget it, I know what I did wrong - I applied the wrong autounattend file. I had to remove references to the disk partitioning, as WDS seems to want to force you to do this manually, but once I did it deployed and Windows was activated.

    Strangely, I'm still losing some of the config that's being captured and correctly set when deployed via USB - e.g. deleted desktop icons are back, pinned task bar icons are gone - while others are fine - e.g. default applications, screen sleep.
    At the moment, I do not have any ideas. I will do some testing, but honestly, I cannot promise you I can find something.

    Kari
      My Computer


  9. Posts : 10
    Windows 10 64-bit Education
    Thread Starter
       #9

    Disaster! We've installed now to another bare bones computer and it too is complaining of a hardware change and running in a non-activated condition.

    I'm confident of the process that's been followed. Could it be the key that's been used that might be causing the problem?

    Regards,
    Robert
      My Computer


  10. Posts : 17,661
    Windows 10 Pro
       #10

    Kidtrebor said:
    Could it be the key that's been used that might be causing the problem?
    Which type of key you are using? Generic, Retail, MAK, KMS?

    Kari
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 20:54.
Find Us




Windows 10 Forums