# Starting a task sequence in an existing OS

Task sequences can also be started in an existing OS.  This can be useful in cases where there is a need to perform any series of steps: installation of apps, applying configuration, etc.  To initiate a task sequence in an existing OS, it is necessary to bootstrap the process using PowerShell.  The process:

* Start an elevated PowerShell.exe session.
* Execute the following commands:

```powershell
iex (irm "https://your-server-name.com:7281/v1/Service/Bootstrap")
```

* When the DeployR client starts, choose the task sequence you want to execute.

To completely automate the process, the task sequence ID can also be specified:

```powershell
iex (irm "https://your-server-name.com:7281/v1/Service/Bootstrap?tsid=00000002-0000-0000-0000-000000000001:1")
```

Additional information can be specified by setting a variable with the list of task sequence variables that should be defined.  For example:

```powershell
$DeployRBootstrap = @{ MyRole = "Accounting" }
iex (irm "https://your-server-name.com:7281/v1/Service/Bootstrap?tsid=00000002-0000-0000-0000-000000000001:1"")
```

### Things to Note

#### Certificates

Certificates are important in this process, the endpoint needs to trust the DeployR server, if you're using a public cert or even an internal CA for DeployR, typically everything will just work without thinking twice, however if you're using the 2PintSoftware self-signed cert, you'll have to add one more step of adding the 2PintSoftware root ca cert into the root certificate store of the endpoint before you try to start the task sequence.  You can distribute the certificate via Intune, GPO, PowerShell etc.  Note, this would be the same certificate you loaded into WinPE.

#### Logs

During the process, it will create the bootstrap log in C:\Windows\Temp and once the TS has started, it will create the DeployR logs in C:\\\_2P\Logs

#### Pre-reqs

To run a task sequence on an existing machine, it requires .Net and PS7 installed, when you run the commands above, it will try to automatically install those before launching.  It will pull those installers from the DeployR server, and not the internet directly.  The example below is from an existing machine that did not have the pre-reqs installed, but then loaded installed them automatically.

#### Console View

```
Transcript started, output file is C:\Windows\Temp\DeployR-bootstrap.log
03/11/2026 08:15:20 Telling Windows to stay awake
03/11/2026 08:15:20 WARNING: No certificates found to inject into root store.
03/11/2026 08:15:21 No PowerShell LTS version found.
03/11/2026 08:15:21 Minimum PowerShell version = 7.4.13
03/11/2026 08:15:21 Installing PowerShell 7.4.13 (old version was '0.0.0')
03/11/2026 08:15:21 MSI path = C:\_2P\Content\00000000-0000-0000-0000-000000000004\PowerShell-7.4.13-win-x64.msi
03/11/2026 08:15:48 Return code = 0
03/11/2026 08:15:48 No .NET Core version found.
03/11/2026 08:15:48 Minimum .NET Core version = 8.0.21
03/11/2026 08:15:48 Installing .NET Core 8.0.21 (old version was '0.0.0')
03/11/2026 08:15:54 Return code = 0
03/11/2026 08:15:59 Return code = 0
03/11/2026 08:16:01 Return code = 0
03/11/2026 08:16:01 Current PATH = C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\SysInternalsSuite\;C:\Program Files\PowerShell\7\;C:\Program Files\Git\cmd;C:\Users\gary.blok\AppData\Local\Microsoft\WindowsApps
03/11/2026 08:16:01 New PATH = C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\SysInternalsSuite\;C:\Program Files\Git\cmd;C:\Program Files\PowerShell\7\;C:\Program Files\dotnet\
03/11/2026 08:16:01 Creating symbolic link to pwsh.exe
03/11/2026 08:16:01 Starting TwoPint.DeployR.ClientShell
```

### Troubleshooting

If it's failing to launch, most of the issues have been around certificates and the endpoint not trusting the DeployR server.  There could be other things as well, .NET installation issues, permissions, network connectivity, etc.\
\
Here is a script on GitHub that you can run after your failed attempt to just double check some of the basics.\
\
<https://github.com/2pintsoftware/2Pint-DeployR/blob/main/Troubleshooting/DeployR-ClientOSChecker.ps1>

<figure><img src="https://744643921-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJO9NLelA0RS8JB4i9oaQ%2Fuploads%2FCli2HyiD4uigwAO9ftX5%2Fimage.png?alt=media&#x26;token=592dab4e-a442-479c-a8a9-34030f4fb6c7" alt=""><figcaption></figcaption></figure>

When looking for assistance, please make sure to include the log or screen capture of that running.
