Here is a guide on how to add Microsoft Diagnostics and Recovery Toolset (DaRT) to a ConfigMgr boot image so it starts first in the boot process, making it possible to remote into WinPE as soon as the boot image has loaded, even before the PXE password and ConfigMgr prestart commands.
Update 2020-09-07: Added support for WinPE from Windows ADK 2004, without this update/fix you wouldn't see command prompt windows in the remote viewer. This is a workaround for a known issue in ADK 2004.
Note: This solution is for ConfigMgr only, for a MDT Lite Touch version of this post, go here: https://deploymentresearch.com/fixing-dart-integration-for-mdt-lite-touch-with-windows-adk-2004/
Credits: Thanks to Alexey Semibratov who created the initial EnableDart.wsf script, and to Sergey Korotkov for the tip on using the /_SMSTSCurrentActionName variable. Also a big thank you to Johan Schrewelius for finding the fix for Windows ADK 2004.

Background
Back in 2011 I wrote a blog post on how to add DaRT to a ConfigMgr 2007 boot image, a scenario that eventually made it into the MDT integration with ConfigMgr 2012 and continued for ConfigMgr Current Branch. The challenge with the implementation Microsoft decided on is that starts quite late in the process, in fact after you selected a task sequence. So various folks (like Alexey) started instead to launch the DaRT component via prestart command in ConfigMgr. But even that is quite late. For example if you have a password protected boot image, the password prompt is before the prestart command runs. I wanted it start even earlier, hence this blog post.
Requirements
You need to have DaRT 10, MDT and the ConfigMgr console installed in order to modify the boot image. Earlier MDT versions should work since the DaRT code haven't changed in a long time, but I haven't tested. Monitoring needs to be enabled on your deployment share, and your CustomSettings.ini file needs to be configured for monitoring (EventService variable set).
You also need to download the sample files: http://github.com/DeploymentResearch/DRFiles/tree/master/Scripts/EnableDaRT
Note: Adding the solution will increase the boot image WIM size with about 7 – 8 MB (16.5 MB uncompressed), shouldn't be a big deal 🙂
Step-by-step Guide
1. Copy the downloaded sample files to a folder, I used C:\Setup\EnableDart.
2. Modify line 13-19 in the Add-DaRTtoBootImage.ps1 script to fit your environment (boot image, sample scripts folder, site server, site code etc.)
3. Modify line 9 in the Unattend.xml file to fit your environment (server name, and monitoring service port)
4. Run the Add-DaRTtoBootImage.ps1 script from an elevated PowerShell prompt.
5. Done 🙂

Happy Deployment, Johan
Do you have to run the script every time you update the boot image?
No, only if you reload the boot image. For example, after updating the ADK.
We tried it in lur company but sometimes only the ipv6 is shown and generally we use ipv4. I tried to increase the time of sleep from. 5 seconds to 15 seconds but it is not be solved, it is shown two ip: one the ipv6 and the second is apipa.do you have any idea?
I would guess it's related to portfast settings being disabled on client ports on your switch, but your network folks should be able to verify that.
You're my favorite person on the planet right now
Thanks 🙂
/ Johan
I am looking to use file shortcuts instead of the event service. What do I need to add to make that happen?
Gary Blok has an example with the shortcut support: https://garytown.com/dart-vnc-remote-during-osd-without-integration
Hello, Johan,
thanks for the great work and i have a question or rather a suggestion. In our company, the OSD installation often starts from USB FlashDisc and with the Static IP configuration, but Dart is already started with the APIPA address. Could it be solved somehow?
Thank you for your time. Marek
You can certainly add some logic to the DaRT script that either sets or refreshes the network information. That being said, I recommend skip using static IP address for deployment, it's just a mess.
Hi again Johan,
I figured out the problem.
Thanks again for your work on this.
Hello there! First things first, thanks you.
I'm using 2004 ADK and i've added the FIX (the new EnableDart.wsf) to my boot image.
It works like a charm, but just in the first boot.
On the next reboot, it stops working, and when i look in the registry, the "HKCU\Console\ForceV2" is back to 1.
I've looked back in the X:\Deploy\Enabledart.wsf and its the latest version with the fix.
What do you think i'm missing Johan?
Are you booting twice into WinPE? Or is the task sequence configured to use a different boot image, and therefore stages it on the hard drive? If so, you need to add this to the other boot image too.
Its the same image, i've doublechecked. On the screenshot you can see the content of X:\Deploy\Enabledart.wsf after the reboot into WINPE. Note that its a reboot from WINPE to WINPE.
After the reboot i can still connect to Dart but theres a hint, maybe its the cause:
EnableDart.log tells me it executed just once, on the first boot into WINPE. Later it prestaged(it sets back the registry keys to the original) and rebooted. Since the EnableDart script doesnt seem to execute on the second boot, F8 stops working.
If rebooting to WinPE a second time your best option is to launch the script via the task sequence.
Now, I might be way off here. But just asking. Can this be done -without- MDT bootimage? Or am I just reading this wrong and infact the boot image is -not- MDT but native CM?
Oh. And HI !! 😀
Yes, there is no dependency on the MDT scripts for the DaRT components, however the script that starts DaRT also reports the IP and Ticket Number to the Deployment Workbench console, allowing to just double-click a machine to remote into it. If you don't want to use the workbench, you can change the script to just create a shortcut in a file share, that you double-click to start the remote session. There are some readymade examples out there 🙂
And HI back! 🙂
I have performed the steps above, but now my test VM will PXE boot and download the boot image but then it reboots as soon as the download is finished. I have injected all kinds of drivers into it even though I've read that you don't have to add drivers if you're using a Hyper-V VM. We are using SCCM 1910 with MDT integration. Any help you can offer would be appreciated.
Press F8 directly after WinPE loads, and check the log files. Opening a command prompt with F8 will prevent reboot too.
Excellent thanks. Had to remember to check "deploy this boot image from the PXE-enabled distribution point", which foxed me for a while but got there in the end 🙂