Set-DSEntryProperty

Synopsis

Set a property on an entry. The entry is not saved to the server.

Syntax

__AllParameterSets

Set-DSEntryProperty [-Entry] <ConnectionInfoEntity> [[-Path] <string>] [-PropertyName] <string>
 [-PropertyValue] <Object> [<CommonParameters>]

Description

Set a property on an entry and return the modified object. The entry is not saved to the server; use Update-DSEntryBase -FromRDMConnection to persist changes. This cmdlet enables pipeline-based property updates, allowing multiple property modifications before saving.

Examples

Example 1

PS C:\> $entry = Get-DSEntry -EntryID "{00000000-0000-0000-0000-000000000000}" -AsRDMConnection
PS C:\> $entry.ConnectionInfo | Set-DSEntryProperty -PropertyName "HostPassword" -PropertyValue "MyNewPassword" | Update-DSEntryBase

Get an entry, set its password, and save it to the server. This is intended for non-credential entries; for credential entries, see the following example.

Example 2

PS C:\> $entry = Get-DSEntry -EntryID "{00000000-0000-0000-0000-000000000000}" -AsRDMConnection
PS C:\> $entry.ConnectionInfo | Set-DSEntryProperty -Path "Credentials" -PropertyName "Password" -PropertyValue "MyNewPassword" | Update-DSEntryBase

Set a credential entry's password.

Example 3

PS C:\> $entry = Get-DSEntry -EntryID "{00000000-0000-0000-0000-000000000000}" -AsRDMConnection
PS C:\> $entry.ConnectionInfo | Set-DSEntryProperty -Path "MetaInformation" -PropertyName "Keywords" -PropertyValue "production web-server critical" | Update-DSEntryBase

Set tags on an entry using the MetaInformation path. Tags are space-separated. Tags containing spaces should be quoted.

Example 4

PS C:\> Get-DSEntry -FilterBy Name -FilterMatch StartsWith -FilterValue "Prod" -SearchAllVaults |
    Set-DSEntryProperty -Path "MetaInformation" -PropertyName "Keywords" -PropertyValue "production" |
    Update-DSEntryBase

Get entries whose name starts with 'Prod' across all vaults and set the 'production' tag on each.

Example 5

PS C:\> $entry = Get-DSEntry -EntryID "{00000000-0000-0000-0000-000000000000}" -AsRDMConnection
PS C:\> $entry.ConnectionInfo |
    Set-DSEntryProperty -PropertyName "Name" -PropertyValue "Production Server" |
    Set-DSEntryProperty -PropertyName "Host" -PropertyValue "server.windjammer.loc" |
    Set-DSEntryProperty -PropertyName "Group" -PropertyValue "Production\Servers\Web" |
    Set-DSEntryProperty -PropertyName "Description" -PropertyValue "Production web server" |
    Set-DSEntryProperty -PropertyName "HostUserName" -PropertyValue "admin" |
    Set-DSEntryProperty -PropertyName "HostDomain" -PropertyValue "WINDJAMMER" |
    Set-DSEntryProperty -PropertyName "HostPassword" -PropertyValue "SecurePass123" |
    Update-DSEntryBase

Chain multiple property updates in a pipeline before saving: rename, change host, move to folder, set its description and its credentials.

Example 6

PS C:\> $entry = Get-DSEntry -EntryID "{00000000-0000-0000-0000-000000000000}" -AsRDMConnection
PS C:\> $entry.ConnectionInfo |
    Set-DSEntryProperty -Path "MetaInformation" -PropertyName "CustomField1Title" -PropertyValue "Department" |
    Set-DSEntryProperty -Path "MetaInformation" -PropertyName "CustomField1Value" -PropertyValue "Engineering" |
    Set-DSEntryProperty -Path "MetaInformation" -PropertyName "CustomField2Title" -PropertyValue "API Key" |
    Set-DSEntryProperty -Path "MetaInformation" -PropertyName "CustomField2ValueSensitive" -PropertyValue "sk-abc123def456" |
    Set-DSEntryProperty -Path "MetaInformation" -PropertyName "CustomField2Hidden" -PropertyValue $true |
    Update-DSEntryBase

Set custom fields on an entry. CustomField[1-5]Value stores plain text, while CustomField[1-5]ValueSensitive automatically encrypts values when saved. Set CustomField[1-5]Hidden to true to mark encrypted fields as sensitive in the UI.

Example 7

PS C:\> $entry = Get-DSEntry -EntryID "{00000000-0000-0000-0000-000000000000}" -AsRDMConnection
PS C:\> $entry.ConnectionInfo |
    Set-DSEntryProperty -Path "MetaInformation" -PropertyName "CustomField1Hidden" -PropertyValue $false |
    Set-DSEntryProperty -Path "MetaInformation" -PropertyName "CustomField1Value" -PropertyValue "plain text value" |
    Update-DSEntryBase

Convert a sensitive custom field to plain text by setting CustomField[1-5]Hidden to false and setting CustomField[1-5]Value. The sensitive value is automatically cleared.

Parameters

-Entry

The entry to modify.

Type: Devolutions.RemoteDesktopManager.Business.Entities.ConnectionInfoEntity
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 0
  IsRequired: true
  ValueFromPipeline: true
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Path

The path to the property (e.g., 'MetaInformation'). Leave empty for top-level properties. This parameter is case-sensitive.

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

-PropertyName

The name of the property to set (e.g., 'HostUserName', 'HostPassword', 'Description'). This parameter is case-sensitive.

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

-PropertyValue

The new value for the property.

Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 3
  IsRequired: true
  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.

Inputs

Devolutions.RemoteDesktopManager.Business.Entities.ConnectionInfoEntity

Entry connection info.

Outputs

Devolutions.RemoteDesktopManager.Business.Entities.ConnectionInfoEntity

Notes

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

Devolutions Forum logo Partagez vos commentaires