> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell/powershell-commands/set-rdmusertag.md).

# Set-RDMUserTag

Set-RDMUserTag replaces the tags assigned to a Remote Desktop Manager user, in full.

### Synopsis

Set the tags of a user.

### Syntax

#### \_\_AllParameterSets

```
Set-RDMUserTag [-User] <IPSUser> [-Tag] <string[]> [-PassThru] [-Set]
 [-ForcePromptAnswer <DialogResult[]>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### Description

Set the tags of a user. This replaces the tags on the user object; use the Set switch to save it, or pass the user to Set-RDMUser to persist the change. The list replaces the user's tags in full, so anything it does not name is cleared: to change one tag and keep the rest, start from the list returned by Get-RDMUserTag. Custom tags may only contain letters, digits, spaces and the characters . - \_ : Contractor is not freely assignable: it identifies a contractor user, so it is refused on any other user and always kept on a contractor one, whether or not the list names it. Requires the permission to edit users.

### Examples

#### Example 1

```powershell
PS C:\> $user = Get-RDMUser -Name 'jdoe'
PS C:\> Set-RDMUserTag -User $user -Tag @('External', 'Finance', 'Tier 1')
PS C:\> Set-RDMUser $user
```

Replaces every tag on the user jdoe, then saves the user. External becomes a system tag; Finance and Tier 1 become custom tags.

#### Example 2

```powershell
PS C:\> Set-RDMUserTag -User (Get-RDMUser -Name 'jdoe') -Tag @('External', 'Finance') -Set
```

Replaces every tag on the user jdoe and saves it in one call, without a separate Set-RDMUser.

#### Example 3

```powershell
PS C:\> Get-RDMUser | Where-Object { $_.Description -like '*service account*' } | ForEach-Object {
    $tags = @(Get-RDMUserTag -User $_)
    $tags += 'Service account'
    Set-RDMUserTag -User $_ -Tag $tags -PassThru
} | Set-RDMUser
```

Tags the users whose description marks them as service accounts, then saves them. Starting from the user's own list is what keeps its other tags.

#### Example 4

```powershell
PS C:\> $user = Get-RDMUser -Name 'jdoe'
PS C:\> Set-RDMUserTag -User $user -Tag @()
PS C:\> Set-RDMUser $user
```

Clears every tag on the user jdoe, then saves the user.

### Parameters

#### -Confirm

Prompts for confirmation before running the cmdlet.

```yaml
Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases:
- cf
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -ForcePromptAnswer

Switch to use with caution. It will automatically answer prompt asking yes/no, yes/no/cancel, or ok/cancel questions. In case of multiple prompts, multiple values can be passed to this parameter. Here are the accepted values:

* Yes: Accept the prompt. Cover the OK and Automatic value.
* No: Refuse the yes/no/cancel prompt. "Cancel" is the fallback option if there is no "No" option.
* Cancel: Cancel the yes/no/cancel prompt. "No" is the fallback option if there is no "Cancel" option.

```yaml
Type: System.Windows.Forms.DialogResult[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -PassThru

Return the modified user.

```yaml
Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -Set

Save the modified user. Without it, the tags are only applied to the in-memory user object.

```yaml
Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -Tag

Tags to assign, obtained from Get-RDMUserTag or given as a list of names. Replaces the user's tags in full: pass an empty array to clear them.

```yaml
Type: System.String[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 1
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -User

User to tag, obtained from Get-RDMUser or New-RDMUser.

```yaml
Type: RemoteDesktopManager.PowerShellModule.PSOutputObject.IPSUser
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 0
  IsRequired: true
  ValueFromPipeline: true
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -WhatIf

Shows what would happen if the cmdlet were to run. The cmdlet does not run.

```yaml
Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases:
- wi
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### 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

#### RemoteDesktopManager.PowerShellModule.PSOutputObject.PSUserInfo

User to tag, obtained from Get-RDMUser or New-RDMUser

#### RemoteDesktopManager.PowerShellModule.PSOutputObject.PSCloudUserInfo

Cloud user to tag, obtained from Get-RDMUser or New-RDMUser

### Outputs

#### RemoteDesktopManager.PowerShellModule.PSOutputObject.PSUserInfo

User with the newly assigned tags when PassThru is specified

#### RemoteDesktopManager.PowerShellModule.PSOutputObject.PSCloudUserInfo

Cloud user with the newly assigned tags when PassThru is specified

### Notes

For more information, type "Get-Help Set-RDMUserTag -detailed". For technical information, type "Get-Help Set-RDMUserTag -full".


---

# 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.devolutions.net/powershell/powershell-commands/set-rdmusertag.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.
