> For the complete documentation index, see [llms.txt](https://docs.patchmypc.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/new-pmpcdeploymentassignment.md). Agents can also search and read this documentation through its [MCP server](https://docs.patchmypc.com/~gitbook/mcp).

# New-PmpcDeploymentAssignment

Builds an assignment for a deployment.

[Back to the Cloud Customer API overview](https://docs.patchmypc.com/patch-my-pc-cloud-api)

## Synopsis

Builds an assignment for a deployment.

## Syntax

### Group (Default)

{% code collapsedlinecount="10" %}

```powershell
New-PmpcDeploymentAssignment [-GroupId] <String> [-Intent] <InstallationIntent>
  [<CommonParameters>]
```

{% endcode %}

### Target

{% code collapsedlinecount="10" %}

```powershell
New-PmpcDeploymentAssignment [-Intent] <InstallationIntent>
  -TargetType <AssignmentTargetType> [<CommonParameters>]
```

{% endcode %}

## Description

Creates the assignment object that New-PmpcDeployment and Set-PmpcDeployment accept, pairing an installation intent with a target.

By default it targets an Entra ID group, given by -GroupId, which is how assignments were always built. To target All Users or All Devices, or to create an install-app/update-only deployment assigned to nobody, pass -TargetType instead of -GroupId.

It exists so assignments can be built at the prompt without constructing a generated-client type by hand.

## Parameters

### -GroupId

Entra ID group the application is assigned to. Targets a group; omit it and pass -TargetType for the other targets.

| Attribute      | Value                          |
| -------------- | ------------------------------ |
| Type           | `System.String`                |
| Required       | True                           |
| Position       | 0                              |
| Pipeline input | True (ByValue, ByPropertyName) |
| Aliases        | None                           |
| Parameter sets | Group                          |

### -Intent

Whether the assignment installs the application or merely makes it available.

| Attribute       | Value                                                                                                                      |
| --------------- | -------------------------------------------------------------------------------------------------------------------------- |
| Type            | `InstallationIntent`                                                                                                       |
| Required        | True                                                                                                                       |
| Position        | 1                                                                                                                          |
| Pipeline input  | True (ByPropertyName)                                                                                                      |
| Aliases         | None                                                                                                                       |
| Accepted values | Unknown, UpdateOnly, Available, Required, Uninstall, AvailableWithoutEnrollment, NoAssignmentsInstall, NoAssignmentsUpdate |
| Parameter sets  | All                                                                                                                        |

### -TargetType

The assignment target when it is not a group: AllUsers, AllDevices, or NotSet for a no-assignment marker. Takes no group id.

| Attribute       | Value                               |
| --------------- | ----------------------------------- |
| Type            | `AssignmentTargetType`              |
| Required        | True                                |
| Position        | Named                               |
| Pipeline input  | False                               |
| Aliases         | None                                |
| Accepted values | AllUsers, AllDevices, Group, NotSet |
| Parameter sets  | Target                              |

### CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

## Inputs

### System.String

The group ID, by value or by the GroupId property.

## Outputs

### CreateDeploymentAssignmentRequest

The assignment object.

## Examples

### Example 1: Build a required assignment

{% code collapsedlinecount="10" %}

```powershell
New-PmpcDeploymentAssignment -GroupId $groupId -Intent Required
```

{% endcode %}

Creates an assignment that installs the application on the group's devices.

### Example 2: Build several assignments

{% code collapsedlinecount="10" %}

```powershell
$app = Get-PmpcCustomApplication -ProductId $productId
$assignments = @(
  New-PmpcDeploymentAssignment -GroupId $pilotGroup -Intent Required
  New-PmpcDeploymentAssignment -GroupId $salesGroup -Intent Available
)
New-PmpcDeployment -ProductId $app.ProductId -CatalogEntryId $app.Custom.CatalogEntryId -OsType Windows -Assignment $assignments
```

{% endcode %}

Makes the application required for a pilot group and available to a second group.

### Example 3: Assign to All Devices

{% code collapsedlinecount="10" %}

```powershell
New-PmpcDeploymentAssignment -TargetType AllDevices -Intent Required
```

{% endcode %}

Targets every managed device in the tenant, with no group. Use AllUsers for every user.

### Example 4: Create an install-app deployment assigned to nobody

{% code collapsedlinecount="10" %}

```powershell
New-PmpcDeploymentAssignment -TargetType NotSet -Intent NoAssignmentsInstall
```

{% endcode %}

Produces the marker the portal writes for an "install app" (or "update only", with NoAssignmentsUpdate) deployment that is assigned to no group.

## Notes

This cmdlet makes no network call and does not require a session.

The -GroupId and -TargetType forms are separate parameter sets: -GroupId targets a group, while -TargetType covers AllUsers, AllDevices and NotSet (a no-assignment marker) and takes no group.

The no-assignment intents (NoAssignmentsInstall, NoAssignmentsUpdate) require the NotSet target: either omit -TargetType or pass -TargetType NotSet. Pairing a no-assignment intent with an explicit AllUsers, AllDevices or Group target is rejected by the broker with a 400 naming the field; it is not silently coerced. Passing -TargetType Group is refused locally, before any call, because that set carries no group id.

## Related links

* [New-PmpcDeployment](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/new-pmpcdeployment.md)
* [Set-PmpcDeployment](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/set-pmpcdeployment.md)
* [PowerShell module](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell.md)

## See also

This cmdlet has no SDK method or REST operation of its own.

* [Cross-reference: cmdlets, SDK methods, and REST operations](https://docs.patchmypc.com/patch-my-pc-cloud-api/cross-reference.md)


---

# 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://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/new-pmpcdeploymentassignment.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.
