> 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/deployment-methods/performing-media-based-deployments.md).

# Performing media-based deployments

Although PXE booting is typically the recommended way to start a bare-metal task sequence, DeployR also supports generating deployment media. Media can operate in four modes:

* **Standalone.** Task sequence metadata and selected content are included on the media. When booting from standalone media, no communication with the DeployR server is needed, so no authentication will be performed. The media must contain every content item required by the task sequence. If something is missing, the task sequence will fail. Steps that require communication with the DeployR server or cloud services (for example, Offline domain join, Autopilot registration, cloud OSes, and cloud driver packs) will not work.
* **Caching.** Task sequence metadata and selected content are included on the media. When booting from the media, the device authenticates with the DeployR server. Content that is not available on the media can be downloaded from the server. Steps that require communication with the DeployR server can therefore still work.
* **Boot** (DeployR 1.3 with the latest updates, and later). Only the Windows PE boot image is written to the media. It behaves like booting from PXE: the device connects to the DeployR server, authenticates, and gets task sequences and content from the server.
* **SelfUpdating** (DeployR 1.4 and later). Boot media that also builds a cache of content as it is used, so later deployments from the same USB drive can use content already cached on the drive. This is a DeployR Enterprise feature. See [Self-updating media](#self-updating-media) below.

The media type is controlled by the `-MediaType` parameter: `Standalone`, `Caching`, `Boot`, or `SelfUpdating`. If you do not specify `-MediaType`, `Caching` is used by default.

## Preparing media content

The `-Tags` parameter filters the task sequences and content items included on the media. When you use a tag such as `Media`, DeployR exports objects that have that tag; it does not inspect a task sequence and automatically include all the content items referenced by it.

For **Standalone** media, this distinction is important: you must tag the task sequence and every content item it requires. This can include the operating system image, driver packs, applications, scripts, and custom content items. If a required item is not included, the task sequence will fail when it tries to use it.

Some built-in DeployR content items are included automatically when you filter by tag. Do not assume that this also includes your own task sequences or their dependencies. Check the export list produced during media creation and confirm that the task sequence and all required content items are present.

### Assigning the Media tag

In the DeployR interface, assign the `Media` tag to:

* The task sequence you want to run from the media.
* Each content item required by that task sequence.

Content item versions are included according to the tags and version status. Ensure the required versions are tagged as well. Deprecated content item versions are excluded from Standalone and Caching media.

If you use a different tag, specify that tag with `-Tags` when creating the media. The examples below use `Media`.

### PowerShell example: assigning the Media tag

{% hint style="warning" %}
**Advanced example — review before use.** This script changes metadata stored on the DeployR server; it does not only change the contents of the ISO or USB drive. It is provided as an example to help administrators automate tag assignment, not as a universal or required preparation step.

The script does not discover task sequence dependencies. You must decide which task sequences and content items belong on the media and enter their names below. Wildcards can match multiple objects. Run the script first with `$Apply = $False`, carefully review every match, and only change it to `$True` when you are sure the selected objects are correct. Test in a controlled environment and follow your organization's change-management process.
{% endhint %}

Run the example in PowerShell 7, in the same session after `Connect-DeployR`. Replace the example names with the exact task sequence and content item names from your environment.

The first run is a preview only. It lists the matching task sequences and content items without changing their metadata.

```powershell
$MediaTag = 'Media'
$Apply = $False

[String[]]$TaskSequenceNames = 'Your task sequence name'
[String[]]$ContentItemNames = 'Your Windows 11 image name', 'Your driver pack name\*'

$AddMediaTag = {
    Param ($Object, $Type)

    $Tags = New-Object 'System.Collections.Generic.List[String]'

    ForEach ($Tag In @($Object.tags)) {
        Switch ([String]::IsNullOrWhiteSpace($Tag)) {
            {($_ -eq $False)} {
                $Tags.Add($Tag)
            }
        }
    }

    Switch ($Tags -icontains $MediaTag) {
        {($_ -eq $False)} {
            $Tags.Add($MediaTag)

            $Object | Add-Member -NotePropertyName 'tags' -NotePropertyValue $Tags.ToArray() -Force

            $Null = $Object | Set-DeployRMetadata -Type $Type
        }
    }
}

$TaskSequences = Get-DeployRMetadata -Type TaskSequence | Where-Object {
    $Name = $_.name
    @($TaskSequenceNames | Where-Object {$Name -ilike $_}).Count -gt 0
}

$ContentItems = Get-DeployRMetadata -Type ContentItem | Where-Object {
    $Name = $_.name
    @($ContentItemNames | Where-Object {$Name -ilike $_}).Count -gt 0
}

Write-Output 'Task sequences matched:'
$TaskSequences | ForEach-Object {Write-Output "  $($_.name)"}

Write-Output 'Content items matched:'
$ContentItems | ForEach-Object {Write-Output "  $($_.name)"}

Switch ($Apply) {
    {($_ -eq $True)} {
        ForEach ($TaskSequence In $TaskSequences) {
            $AddMediaTag.Invoke((Get-DeployRMetadata -Type TaskSequence -Id $TaskSequence.id), 'TaskSequence')
        }

        ForEach ($ContentItem In $ContentItems) {
            $Item = Get-DeployRMetadata -Type ContentItem -Id $ContentItem.id

            $AddMediaTag.Invoke($Item, 'ContentItem')

            ForEach ($VersionNo In @($Item.versions.versionNo)) {
                $AddMediaTag.Invoke((Get-DeployRMetadata -Type ContentItemVersion -Id $ContentItem.id -Version $VersionNo), 'ContentItemVersion')
            }
        }

        Write-Output 'Media tag applied.'
    }
}
```

After reviewing the preview, if the matches are correct, set `$Apply = $True` and run the script again. Review the output and verify the tags in DeployR before creating the media. The script applies the tag to every version it finds for each matched content item; Deprecated versions are still excluded from Standalone and Caching media.

## Creating media

To generate media, sign in to the DeployR server and open a PowerShell 7 session. Import the DeployR.Utility PowerShell module and authenticate with the DeployR server:

```powershell
Import-Module "C:\Program Files\2Pint Software\DeployR\Client\PSModules\DeployR.Utility"
Connect-DeployR -Passcode "DeployR"
```

### Creating USB media

With no parameters, `New-DeployRMedia` lists the available removable USB devices that can be used:

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

To create the media, specify the disk number shown in the list. The following example creates Standalone media using items tagged `Media`:

```powershell
New-DeployRMedia -DiskIndex 2 -Tags Media -MediaType Standalone
```

The USB drive must be attached to the computer running the command. **This is a destructive operation:** the specified USB drive will be reformatted into two partitions, with boot files on a FAT32 partition and other content on an NTFS partition (to support files larger than 4 GB). Verify the disk index carefully before running the command. Depending on the amount of selected content, creation can take some time. When complete, eject the USB drive and use it to boot a client device.

### Creating ISO media

For virtual machines, you can create an ISO instead:

```powershell
New-DeployRMedia -ISOPath C:\Media.iso -Tags Media -MediaType Standalone
```

Attach the resulting ISO to a virtual machine and boot the device from it. Check the export list during creation to confirm that the intended task sequence and required content items are included. If the ISO is unexpectedly small, review the tag assignments before creating it again.

## Additional options

* **Deprecated versions are excluded.** Content item versions with a status of **Deprecated** are not copied to Standalone or Caching media.
* **-TempPath.** `New-DeployRMedia` stages files in the system temporary folder. If that drive does not have enough free space, specify another folder: `New-DeployRMedia -DiskIndex 2 -MediaType Standalone -TempPath D:\Temp`.
* **-Architecture.** Creates media for `x64` (the default) or `arm64` devices. Items tagged for an architecture that does not match the selected media architecture are not included. For example, ARM64-tagged items are not included in the default x64 media.
* **-NoBoot.** Leaves out the boot image.

## Standalone media limitations

Standalone media does not communicate with the DeployR server when the task sequence runs. Therefore, task sequence steps that require the DeployR server or cloud services cannot complete. This includes Offline domain join, Autopilot registration, cloud OSes, and cloud driver packs.

Imported driver packs that are available as regular DeployR content items can be included on the media. Use the **Inject drivers** task sequence step for these local content items; **Inject drivers from cloud** requires cloud connectivity and is not suitable for an offline standalone deployment.

If a deployment requires server communication or content that is not included on the media, consider using Caching or Boot media instead.

## Self-updating media

{% hint style="info" %}
This is only supported in DeployR Enterprise. Applies to: DeployR 1.4 and later.
{% endhint %}

Self-updating media works with the StifleR client to cache and peer all BranchCache-enabled content automatically while the DeployR client downloads it. The downloaded data is saved to the USB drive, so later downloads can be read from the USB drive instead of from the DeployR server or from other peers. This can greatly improve performance.

The cache also helps when content changes. A large part of a new content version is usually the same as the previous one, so only the parts that changed need to be downloaded.

The media starts out with only the boot image, like the Boot media type. The data partition is labeled `2PintHybrid` and holds the cache (in the `Storage` folder) instead of DeployR task sequences and content. Create it the same way as other media:

```powershell
New-DeployRMedia -DiskIndex 2 -MediaType SelfUpdating
```


---

# 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/deployment-methods/performing-media-based-deployments.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.
