When running a Build and Capture Task Sequence in MDT – and are using Windows update to getting the image update date. Some times it will fail because some Windows Store Apps are getting update in the user context – and then are a different version than the App that are provisioned in the Operating System.
In the C:\Users\ADMINI~1\AppData\Local\Temp\SMSTSLog\SMSTS.LOG can you see that sysprep is failing
<![LOG[Start executing the command line: cscript.exe “%SCRIPTROOT%\LTISysprep.wsf”]LOG]!><time=”16:55:17.561-120″ date=”04-13-2017″ component=”TSManager” context=”” type=”1″ thread=”4940″ file=”instruction.cxx:731″>
<![LOG[!——————————————————————————————–!]LOG]!><time=”16:55:17.561-120″ date=”04-13-2017″ component=”TSManager” context=”” type=”1″ thread=”4940″ file=”instruction.cxx:760″>
<![LOG[Expand a string: ]LOG]!><time=”16:55:17.561-120″ date=”04-13-2017″ component=”TSManager” context=”” type=”0″ thread=”4940″ file=”executionenv.cxx:776″>
<![LOG[Executing command line: cscript.exe “%SCRIPTROOT%\LTISysprep.wsf”]LOG]!><time=”16:55:17.561-120″ date=”04-13-2017″ component=”TSManager” context=”” type=”1″ thread=”4940″ file=”commandline.cpp:828″>
<![LOG[Process completed with exit code 6192]LOG]!><time=”16:55:20.780-120″ date=”04-13-2017″ component=”TSManager” context=”” type=”1″ thread=”4940″ file=”commandline.cpp:1124″>
<![LOG[!——————————————————————————————–!]LOG]!><time=”16:55:20.780-120″ date=”04-13-2017″ component=”TSManager” context=”” type=”1″ thread=”4940″ file=”instruction.cxx:814″>
<![LOG[Could not find CCM install folder. Don’t use ccmerrors.dll]LOG]!><time=”16:55:20.780-120″ date=”04-13-2017″ component=”TSManager” context=”” type=”0″ thread=”4940″ file=”string.cpp:1364″>
<![LOG[Failed to run the action: Execute Sysprep.
Unknown error (Error: 00001830; Source: Unknown)]LOG]!><time=”16:55:20.780-120″ date=”04-13-2017″ component=”TSManager” context=”” type=”3″ thread=”4940″ file=”instruction.cxx:921″>
<![LOG[Executing in non SMS standalone mode. Ignoring send a task execution status message request]LOG]!><time=”16:55:20.780-120″ date=”04-13-2017″ component=”TSManager” context=”” type=”1″ thread=”4940″ file=”utils.cpp:6143″>
<![LOG[Set a global environment variable _SMSTSLastActionRetCode=6192]LOG]!><time=”16:55:20.780-120″ date=”04-13-2017″ component=”TSManager” context=”” type=”0″ thread=”4940″ file=”executionenv.cxx:662″>
<![LOG[Set a global environment variable _SMSTSLastActionSucceeded=false]LOG]!><time=”16:55:20.780-120″ date=”04-13-2017″ component=”TSManager” context=”” type=”0″ thread=”4940″ file=”executionenv.cxx:662″>
<![LOG[Clear local default environment]LOG]!><time=”16:55:20.780-120″ date=”04-13-2017″ component=”TSManager” context=”” type=”0″ thread=”4940″ file=”executionenv.cxx:801″>
<![LOG[Let the parent group (Capture Image) decides whether to continue execution]LOG]!><time=”16:55:20.795-120″ date=”04-13-2017″ component=”TSManager” context=”” type=”0″ thread=”4940″ file=”instruction.cxx:1033″>
<![LOG[Let the parent group (Imaging) decide whether to continue execution]LOG]!><time=”16:55:20.795-120″ date=”04-13-2017″ component=”TSManager” context=”” type=”0″ thread=”4940″ file=”instruction.cxx:258″>
<![LOG[Let the parent group (State Restore) decide whether to continue execution]LOG]!><time=”16:55:20.795-120″ date=”04-13-2017″ component=”TSManager” context=”” type=”0″ thread=”4940″ file=”instruction.cxx:258″>
<![LOG[The execution of the group (State Restore) has failed and the execution has been aborted. An action failed.
Operation aborted (Error: 80004004; Source: Windows)]LOG]!><time=”16:55:20.795-120″ date=”04-13-2017″ component=”TSManager” context=”” type=”3″ thread=”4940″ file=”instruction.cxx:221″>
<![LOG[Could not find CCM install folder. Don’t use ccmerrors.dll]LOG]!><time=”16:55:20.795-120″ date=”04-13-2017″ component=”TSManager” context=”” type=”0″ thread=”4940″ file=”string.cpp:1364″>
<![LOG[Failed to run the last action: Execute Sysprep. Execution of task sequence failed.
Unknown error (Error: 00001830; Source: Unknown)]LOG]!><time=”16:55:20.795-120″ date=”04-13-2017″ component=”TSManager” context=”” type=”3″ thread=”4940″ file=”engine.cxx:246″>
In setup error loggen c:\windows\system32\sysprep\panther\setuperr.log we can see that a UWP app is installed but not provisioned for all users.
2017-04-13 16:55:20, Error SYSPRP Package Microsoft.WindowsCalculator_10.1605.1582.0_x64__8wekyb3d8bbwe was installed for a user, but not provisioned for all users. This package will not function properly in the sysprep image.
2017-04-13 16:55:20, Error SYSPRP Failed to remove apps for the current user: 0x80073cf2.
2017-04-13 16:55:20, Error SYSPRP Exit code of RemoveAllApps thread was 0x3cf2.
2017-04-13 16:55:20, Error [0x0f0082] SYSPRP ActionPlatform::LaunchModule: Failure occurred while executing ‘SysprepGeneralizeValidate’ from C:\Windows\System32\AppxSysprep.dll; dwRet = 0x3cf2
2017-04-13 16:55:20, Error SYSPRP SysprepSession::Validate: Error in validating actions from C:\Windows\System32\Sysprep\ActionFiles\Generalize.xml; dwRet = 0x3cf2
2017-04-13 16:55:20, Error SYSPRP RunPlatformActions:Failed while validating SysprepSession actions; dwRet = 0x3cf2
2017-04-13 16:55:20, Error [0x0f0070] SYSPRP RunExternalDlls:An error occurred while running registry sysprep DLLs, halting sysprep execution. dwRet = 0x3cf2
2017-04-13 16:55:20, Error [0x0f00d8] SYSPRP WinMain:Hit failure while pre-validate sysprep generalize internal providers; hr = 0x80073cf2
As you can see here – some of the apps are updated during the Build and Capture process because it is on the internet and are communicating with the update service in Windows Store.
To get around this issue you need to disable the feature that are updating the Windows Store Apps while running the Build and Capture Task Sequence – the best way to do this is to put a regkey into the unattend.xml file so it is disabled on the first boot.
Insert This in unattend.xml
<RunSynchronousCommand wcm:action=”add”>
<Description>Always_Off_Store_Automatic_Download_Install_Updates</Description>
<Order>6</Order>
<Path>reg add HKLM\SOFTWARE\Policies\Microsoft\WindowsStore /v AutoDownload /t REG_DWORD /d 2 /f</Path>
</RunSynchronousCommand>
At the end of the Task Sequence create a “Run Command Line” action with this command line:
reg Delete HKLM\SOFTWARE\Policies\Microsoft\WindowsStore /v AutoDownload /f
And now you can run a Build and Capture Task Sequence – getting the Operating System updated from Windows Update with out breaking the sysprep step.