CopyProfile



  • I was looking at your answer file and I noticed you had <CopyProfile>true</CopyProfile> set. Anytime I set this to true I get an error in setup that boot loops...when set to false it does not.



  • What Windows account are you using to build your image and start sysprep with your answer file? What I did today was perform a clean install of Windows 10 x64 (version 1607) and at a certain point of setup, I put the OS in Audit Mode (SHIFT+CTRL+F3). The system boots and loads the local Administrator account. I install all drivers, software, etc and then run a script to start sysprep. What does your script look like that begins sysprep with the answer file?



  • I am using a local account I created and that may be the issue, I am going to try Audit Mode with the built in. Do you manually enter your computer into AD, trying to make mine as hands-free as possible. Thanks for your help, your posts in the forums have been a big help.



  • I never manually enter my PC hostname into AD. I have the ComputerName component in my .xml file and then when I deploy the image with CloneDeploy, it picks up that I have this component and it automatically renames the PC. So when my PC is finished deploying and my startup scripts have been ran, I have a PC, with the correct name, and is joined to my Domain. I don't have to touch the machine once this process is done.

    <ComputerName>CloneDeploy</ComputerName>



  • Don't you have to manually add the computer to AD for it to be able to join the domain?



  • As far as joining to my Domain, this is a part of the process that I have configured to run once I deploy the image with CloneDeploy. I copied this text from a previous post. I've been doing it this way for a couple of years now and it works for me. I never have to manually add a PC to my Domain once I push down an image from CloneDeploy.

    Start

    There may be a better/easier way to do this but this way works for me. Below is a listing of files and directories that I use to accomplish the sysprep, activation of Windows and Office, and domain join. Let me know if you have any questions.

    • At the root of C:, create a directory called Scripts.

    • In C:\Windows\Setup, create a folder called Scripts and then create a file called SetupComplete.cmd. The only thing I have in this file is a command to call my .bat file that does various tasks after reimaging.

    • In C:\Windows\System32\Sysprep, create a file called StartSysprep.bat. This file will first re-arm Office and then start sysprep and when finished, it will shutdown the PC. The re-arm Office command, is configured to re-arm Office 2016. If you have Office 2013 or 2007, you will need to change the path to the .exe that is referenced. Also in this directory you will need to create and store your .xml file for sysprep. You can use Windows System Image Manager to create your .xml. Be sure to include the component to change the computer name and make sure you call your .xml file unattend.xml.

    • In C:\Scripts, create a .bat file called SetupFinalize.bat and a Powershell script called JoinDomain.ps1. The JoinDomain.ps1 file is the file used to actually join the PC to your domain. Be sure to modify it with your domain information. The SetupFinalize.bat has several commands in it that run after the system has been deployed with a new image. One command activates Office, one activates Windows, one calls JoinDomain.ps1, and the rest of the command deletes certain files. Finally, it reboots the PC once joined to domain.

    SetupComplete.cmd:
    C:\Scripts\SetupFinalize.bat

    StartSysprep.bat:
    REM Rearms Office
    "C:\Program Files (x86)\Microsoft Office\Office16\ospprearm.exe"
    REM Starts Sysprep with the unattend.xml file
    sysprep /generalize /oobe /shutdown /unattend:unattend.xml

    SetupFinalize.bat:
    REM Activating Windows
    cscript //b C:\Windows\System32\slmgr.vbs /ato
    REM Activating Office
    cscript "C:\Program Files (x86)\Microsoft Office\Office16\ospp.vbs" /act
    REM Running Powershell script to join to Domain
    Powershell.exe -ExecutionPolicy Unrestricted -File C:\Scripts\JoinDomain.ps1
    REM Deleting some password sensitive files
    del /Q /F C:\Windows\System32\sysprep\unattend.xml
    del /Q /F C:\Windows\panther\unattend.xml
    del /Q /F C:\Scripts\Sysprep\unattend.xml
    del /Q /F C:\Scripts\JoinDomain.ps1
    REM Rebooting PC
    shutdown /r /f /t 15

    JoinDomain.ps1:
    $domain = “YourDomainHere”
    $user = "UserToUseToJoinToDomain"
    $password = “EnterUserPasswordHere” | ConvertTo-SecureString -asPlainText -Force
    $username = “$domain name$user”
    $credential = New-Object System.Management.Automation.PSCredential($username,$password)
    Add-Computer -DomainName $domain -Credential $credential

    End