Skip to content
DnsLister Forum

Where domain hunters compare notes

Community Edition: Reimage Task Sequence Fails When Started from Full Windows OS

In Community Edition 3.1.2629.647, I have a Win11 amd64 25H2 task sequence that works great when started from WinPE. I am trying to also be able to initiate it from a running Windows 11 OS per Starting a task sequence in an existing OS | DeployR | Product Documentation

From a domain joined Win11 system

First, when I run iex (irm "https://your-server-name.com:7281/v1/Service/Bootstrap?tsid=00000002-0000-0000-0000-000000000001:1") (with my TS GUID of course) I get the following error:

https://preview.redd.it/dixd4asrx5mh1.png?width=957&format=png&auto=webp&s=303bca56d89d3626af9c92d9beeb212a5a67ee6d

The bootstrap script that runs, tries to set the execution policy to Bypass, but we have a policy that sets execution policy to remote signed, which prevents the script from changing it.

https://preview.redd.it/557q2iyiy5mh1.png?width=401&format=png&auto=webp&s=3fbcd27eb09ba64dddba275f5a2184d50967ede7

I can get around this by first changing/deleting the registry entry that sets the execution policy:

HKLM\SOFTWARE\Policies\Microsoft\Windows\PowerShell – ExecutionPolicy

If I change that registry value to Bypass or delete it, the bootstrap runs fine and the task sequence launches. I have the first step of the task sequence set to Reboot to Windows PE with a condition of IsWindowsPE Equals False. It properly downloads the WinPE wim and reboots into WinPE.

This is where I run into an issue. It fails after the Format disk step. The log shows error:

Task sequence failed due to unexpected System.IO.DirectoryNotFoundException error; Could not find a part of the path 'S:\_2P\state\variables.json'.

When I look in S:\_2P, I have the following subfolders: Client, content, Logs

I assume the state folder is not restored after the format disk and causing the failure.

Am I overlooking a step that I need to add before the format disk to ensure the proper files are backed up and then restored so the TS can continue?

Source: r/DeployR · by /u/kaiserking13

Leave a Reply

Your email address will not be published. Required fields are marked *