One issue I’ve seen happen to me many times with MDT is having it fire off to a Refresh install without me even telling it to do that. I realized this only happened in a certain circumstance.
- Deployment Summary NOT skipped
- The desktop went through a refresh via MDT
- The desktop left running at the refresh task summary for an extended period of time, to the point where (I believe) Windows Updates or another process restarts it. Running WU as part of a pre-post app task may actually make MDT work correctly.
Its a rare event and I didn’t capture exactly why this happened, however I know most of the story and I didn’t want to skip the deployment summary to get by this. In short: the cleanup starts before the Deployment Wizard Summary, however not all of it. Finish must be pressed to get the rest. If the system is restarted before the Finish button is pressed MDT will not start up next run. Instead there will be MININT and _SMSTaskSequence folders remaining and they will trick MDT into thinking that the entire task has to be started over.
One solution I’m testing out right now is to have those directories cleared out on reboot, from a registry runonce value run before the deployment summary shows. Code is as follows:
Dim strRegValue, strWinRunOnce Dim objShell strRegValue = "cmd /c rd c:\miniNT /s /q && rd c:\_SMSTaskSequence /s /q" strWinRunOnce = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\MdtCleanup" Set objShell = CreateObject("WScript.Shell") objShell.RegWrite strWinRunOnce, strRegValue, "REG_SZ"
I just put this code before the comment ‘Display the final summary wizard (unless skipped)’ within LiteTouch.wsf.
Do note that any old media used to install might need to be updated (as this file is local on CD’s/USB’s). This script may only work when logging in as an admin.