Automation
Now let's put this all together in with some Automation
AutoUnattend.xml
Execution Policy
Add Modules
Commands
<settings pass="windowsPE">
<component name="Microsoft-Windows-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">
<UserData>
<AcceptEula>true</AcceptEula>
<ProductKey>
<Key>NPPR9-FWDCX-D2C8J-H872K-2YT43</Key>
<WillShowUI>Never</WillShowUI>
</ProductKey>
</UserData>
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Description>ExecutionPolicy Bypass</Description>
<Path>PowerShell -WindowStyle Hidden -Command "Set-ExecutionPolicy Bypass"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>2</Order>
<Description>Add PowerShell Modules</Description>
<Path>PowerShell -Command "& {OSDWinPE -Modules -Verbose; Pause}"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>3</Order>
<Description>OSD Settings</Description>
<Path>PowerShell -Command "& {OSDPower High -Verbose; OSDWinPE -InitializeNetwork -DisableFirewall -UpdateBootInfo -RemoteRecovery -Verbose; Pause}"</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
</settings>Execution
The first console that we see is to add the Modules. Press Enter to continue

The second one is for the settings. Press Enter to continue

Full Automation
Once we verify that everything looks good, the Windows can be Hidden, and we can even use PowerShell Transcripts to see how things went. To fully automate everything, simply use the following commands in the AutoUnattend.xml
And this is the result, looks like nothing happened. Microsoft DaRT Remote Recovery will be accessible by pressing ALT + TAB

A closer look shows that everything is set properly

PowerShell Transcripts are saved in X:\Sources if you want a closer look

Last updated
Was this helpful?