> For the complete documentation index, see [llms.txt](https://documentation.2pintsoftware.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.2pintsoftware.com/deployr/troubleshooting/task-sequence-filtering.md).

# Task sequence filtering

In version 1.1 and later, you can use the bootstrap.json file to have the DeployR task sequence selection dialog box show only a subset of task sequences.

### Filter Logic

Filtering uses a PowerShell `Where-Object`-style expression. The DeployR task sequence selector reads the specified argument from `bootstrap.json` and uses it to filter the available task sequences.

To learn more about the Bootstrap.json file, see [Task Sequence debugging](/deployr/troubleshooting/task-sequence-debugging.md)

The task sequence metadata is available during the filtering stage, so any of its properties can be used in the filter. You can see them in PowerShell or the console; PowerShell shows the exact output that the filter uses:

<figure><img src="https://content.gitbook.com/content/8m0VARX9oyZ2zXWCdPgr/blobs/sCJ6xDjxEwApD1UbpRCq/image.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/8m0VARX9oyZ2zXWCdPgr/blobs/SUQo4PjTDuhSP2vgwCmx/image.png" alt=""><figcaption></figcaption></figure>

Tags are recommended because they are easy to set and modify, and each item can have multiple tags. Once you have chosen the metadata to filter on, update the Bootstrap configuration. This example is for when the task sequence has a tag of "Standard" associated with it.

syntax: "TaskSequenceFilter":"$\_.Tags -contains 'Standard'"

That will be appended to the entire Bootstrap.json like so:

```
{"Variables":{"DeployRHost":"https://214-DeployR.2p.garytown.com:7281","Anonymous":"true","Custom":"true","debug":"true","TaskSequenceFilter":"$_.Tags -contains 'Standard'"}}
```

<figure><img src="https://content.gitbook.com/content/8m0VARX9oyZ2zXWCdPgr/blobs/7ucU7oofV5f6Nwjgj4fA/image.png" alt=""><figcaption></figcaption></figure>

Then when the boot media is generated, it filters the task sequences shown to just the ones that have been tagged with "Standard", even though the server has 23 task sequences on it.

<figure><img src="https://content.gitbook.com/content/8m0VARX9oyZ2zXWCdPgr/blobs/LQfcBHJfmA4jIUXYLeIz/image.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/8m0VARX9oyZ2zXWCdPgr/blobs/BLSLYyortJj1yeOG3AUB/image.png" alt=""><figcaption></figcaption></figure>

### More Examples

Here are additional examples, just for ideas. Some of the basic task sequence variables will be available to filter on, which will be shown in a few of the examples below.

#### Filtering based on client's network (DEFAULTGATEWAY001)

In this example, you tag a task sequence with the default gateways of specific networks, and the task sequence shows up only on those networks. Here, a server task sequence is available when the default gateway is that of my server network, 192.168.20.1.

```
"$_.Tags -contains $tsenv:DEFAULTGATEWAY001"
```

<figure><img src="https://content.gitbook.com/content/8m0VARX9oyZ2zXWCdPgr/blobs/YeeFv9AHFbIxlPOI92v4/image.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/8m0VARX9oyZ2zXWCdPgr/blobs/MYPb98MbfMrno1Dv2mu8/image.png" alt=""><figcaption></figcaption></figure>

#### Filtering based on client's model

In this example, the filter lists task sequences based on the model of the workstation.

```
"$_.Tags -contains $tsenv:MODEL"
```

<figure><img src="https://content.gitbook.com/content/8m0VARX9oyZ2zXWCdPgr/blobs/PkBBMp5oAog5ml0f75yq/image.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/8m0VARX9oyZ2zXWCdPgr/blobs/tWK1LUIzEaIAFyodz3D7/image.png" alt=""><figcaption></figcaption></figure>

### Summary

Filtering on task sequence metadata, strings, and variables gives you a lot of control over which task sequences are available for the end user to select.

This requires updating your Bootstrap.json file and regenerating your boot media for each variation of the bootstrap.json file.

### iPXE Web Service Bonus

With the iPXE Web Service, additional files can be added to the process dynamically, with no need to regenerate the boot media. Several JSON files can be preconfigured and then chosen from an iPXE menu.\
\
Bootstrap JSON files on web server:

<figure><img src="https://content.gitbook.com/content/8m0VARX9oyZ2zXWCdPgr/blobs/gUawNywm2Mqeasr6k46h/image.png" alt=""><figcaption></figcaption></figure>

Menu item in iPXEboot.ps1<br>

<figure><img src="https://content.gitbook.com/content/8m0VARX9oyZ2zXWCdPgr/blobs/tEduJktXP3KUDLAilMk7/image.png" alt=""><figcaption></figcaption></figure>

Custom iPXE Menu (iPXEboot.ps1 file)

<figure><img src="https://content.gitbook.com/content/8m0VARX9oyZ2zXWCdPgr/blobs/ocirM49wZaiPuNc80cFJ/image.png" alt=""><figcaption></figcaption></figure>

With iPXE web service, unique menu items can be added, then different filters applied to each.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://documentation.2pintsoftware.com/deployr/troubleshooting/task-sequence-filtering.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
