> 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/rdm/knowledge-base/knowledge-base-articles/entry-settings/custom-powershell-synchronizer.md).

# Custom (PowerShell) synchronizer

Use the Custom PowerShell synchronizer in Remote Desktop Manager to populate vaults, sync descriptions, and apply templates via scripts.

This entry is a powerful "hybrid" synchronizer that lets you use PowerShell scripts to populate vaults, sync descriptions, apply templates and more. You can synchronize from sources that we don’t have a dedicated synchronizer for. It leverages proxy classes to interact with rich Remote Desktop Manager connection objects.

{% hint style="info" %}
See [PowerShell commands](https://docs.devolutions.net/powershell/powershell-commands) for a list of Devolutions' custom PS commands, complete with descriptions, examples, and supported common parameters.
{% endhint %}

{% hint style="info" %}
The ***Schedule*** tab is only available when the data source supports scheduled synchronizers, such as Devolutions Server.
{% endhint %}

<table data-header-hidden><thead><tr><th width="200"></th><th></th></tr></thead><tbody><tr><td><strong>SETTINGS</strong></td><td><strong>DESCRIPTION</strong></td></tr><tr><td><strong>Name</strong></td><td>The name of the entry. The name cannot contain a backslash.</td></tr><tr><td><strong>Folder</strong></td><td>The folder where the entry is located.</td></tr><tr><td><strong>Credentials</strong></td><td>The credentials of the entry. Read more on <a href="/rdm/ribbon-menu-bar/edit/entry-credentials-options.md"><em><strong>Credentials</strong></em> options</a>.</td></tr><tr><td><strong>Synchronize automatically</strong></td><td>Include this synchronizer when Remote Desktop Manager runs synchronizers automatically.</td></tr></tbody></table>

### General

<table><thead><tr><th width="220">SETTINGS</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td><strong>Template</strong></td><td>The template applied to the entries created by the script.</td></tr><tr><td><strong>Destination folder</strong></td><td>The folder where the synchronized entries are created. Use the browse button to pick an existing folder or the add button to create one. The text field can only be typed in when the data source allows virtual folders.</td></tr><tr><td><strong>Duplicate check</strong></td><td><p>The scope used to detect existing entries:</p><ul><li><strong>Root</strong></li><li><strong>Destination folder</strong></li></ul></td></tr><tr><td><strong>Folder creation mode</strong></td><td><p>How the folders of the synchronized entries are created:</p><ul><li><strong>Folder entry</strong></li><li><strong>Create virtual folders</strong></li></ul></td></tr></tbody></table>

### Script

<table><thead><tr><th width="220">SETTINGS</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td><strong>Script</strong></td><td>The PowerShell script that creates the entries. Click the <em><strong>Advanced script editor</strong></em> button above the editor to edit the script in a separate window.</td></tr><tr><td><strong>Timeout (ms)</strong></td><td>The maximum time, in milliseconds, allowed for the script to run. Accepts a value from 0 to 60000.</td></tr><tr><td><strong>Example</strong></td><td>A read-only sample script that shows how to create entries with <code>$RDM.Add</code> and set their properties.</td></tr></tbody></table>

### Parameters

<table><thead><tr><th width="220">SETTINGS</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td><strong>Parameter name</strong></td><td>The name of each of the five script parameters, <em><strong>Parameter #1</strong></em> to <em><strong>Parameter #5</strong></em> by default. Click a name to rename the parameter. Leaving the new name empty restores the default name.</td></tr><tr><td><strong>Default value</strong></td><td>The value of the parameter, entered in a masked field. Use <code>$PARAMETER1$</code> for the first parameter, <code>$PARAMETER2$</code> for the second, and so on, to insert the values in the script.</td></tr></tbody></table>

### Schedule

<table><thead><tr><th width="220">SETTINGS</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td><strong>Enabled</strong></td><td>Run the synchronizer on a schedule.</td></tr><tr><td><strong>Every</strong></td><td><p>The interval between runs, set as a number (minimum 1) and a unit:</p><ul><li><strong>Days</strong></li><li><strong>Hours</strong></li></ul></td></tr><tr><td><strong>At</strong></td><td>The time of day the synchronizer runs. Available when the interval unit is <em><strong>Days</strong></em>.</td></tr></tbody></table>

### Advanced

<table><thead><tr><th width="220">SETTINGS</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td><strong>Silent mode</strong></td><td>Run the synchronizer in silent mode.</td></tr><tr><td><strong>Sync description</strong></td><td>Synchronize the description of the entries.</td></tr><tr><td><strong>Sync group</strong></td><td>Synchronize the folder of the entries.</td></tr><tr><td><strong>Sync tags</strong></td><td>Synchronize the tags of the entries.</td></tr><tr><td><strong>Action on entry mismatch</strong></td><td><p>The action applied to an entry created by this synchronizer that no longer matches the synchronized data:</p><ul><li><strong>None</strong></li><li><strong>Delete</strong></li><li><strong>Move to</strong> — Move the entry to the folder set in <em><strong>Destination folder</strong></em>, displayed below the list.</li><li><strong>Make expired</strong> — Mark the entry as expired with the text set in <em><strong>Expiration message</strong></em>, displayed below the list.</li></ul></td></tr></tbody></table>

### Custom (PowerShell) synchronizer use cases

**Simple session**

Provide the host, name, description and group while using the default RDP type. Alternatively, use a template to promote reuse and standardization. Here is an example:

```powershell
# Obtain or generate your list of sessions to create, here we assume a $data table.
# Has been filled by querying an external source.
Foreach($row in $data)
{
  # Create a new session, the only mandatory property is 'Name' so we require it as a parameter in the Add method.
  $session = $RDM.Add($row.Name)
  # Set the other properties using $session.
  $session.Host = $row.Name
  $session.Description = $row.Description
  $session.Group = $row.Group # it can be multiple levels i.e. 'Folder1\Folder1a'
}
```

**Session with credentials**

To set the credentials, use: `$session.SetCredentials($row.Username, $row.Password, $row.Domain);`.

To only set the password, use: `$session.SetPassword($row.Password);`.

{% hint style="info" %}
The password cannot be set using `$session.Password`.
{% endhint %}

**Commonly used fields**

Here are commonly used fields for quick reference:

```
string CustomStatus
string Description
bool Encrypt
string Group
string Host
bool IncludeInFavorite
string Name
bool OpenEmbedded
bool ShowInTrayIcon
int SortPriority
<Color>#FF0000</Color>
string GroupTab
string Status
string TabTitle
```

**Advanced scenario**

By using the method outlined in [Reverse engineering an entry's structure](https://docs.devolutions.net/powershell/remote-desktop-manager-powershell/powershell-scripting/list-of-property-names-for-powershell-script#reverse-engineering-an-entrys-structure), you can create an entry with all required information in the appropriate fields and observe how to assign values using PowerShell.\
\
For example, here is a ***Host*** entry for which many fields of the ***View*** – ***Asset*** section have been filled:

```xml
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfConnection>
  <Connection>
    <AppVersion>~SET AUTOMATICALLY~</AppVersion>
    <Color>#FF0000</Color>
    <ConnectionType>Host</ConnectionType>
    <CreatedBy>~SET AUTOMATICALLY~</CreatedBy>
    <CreationDateTime>~SET AUTOMATICALLY~</CreationDateTime>
    <Description>phDescription</Description>
    <GroupTab>phTabGroupName</GroupTab>
    <ID>~SET AUTOMATICALLY~</ID>
    <Name>phName</Name>
    <OpenEmbedded>true</OpenEmbedded>
    <SortPriority>100</SortPriority>
    <Status>{123A44CB-7EDC-4ecb-926B-031793668148}</Status>
    <TabTitle>phTabPageTitle</TabTitle>
    <HostDetails>
      <Host>phName</Host>
    </HostDetails>
    <MetaInformation>
      <AssetSubType>Desktop</AssetSubType>
      <Domain>metadomain</Domain>
      <IP>metaIP</IP>
      <Keywords>MyTag1</Keywords>
      <MAC>metamac</MAC>
      <MachineName>metaHost</MachineName>
      <NetworkDHCPRange>MetaDHCPRange</NetworkDHCPRange>
      <NetworkDHCPServer>MetaDHCPServer</NetworkDHCPServer>
      <NetworkFirewallZone>MetaFirewall</NetworkFirewallZone>
      <NetworkGateway>MetaGateway</NetworkGateway>
      <NetworkIPRange>metaIPRange</NetworkIPRange>
      <NetworkSubnet>metaSubnet</NetworkSubnet>
      <NetworkVLANID>MetaVlan</NetworkVLANID>
      <OS>metaos</OS>
    </MetaInformation>
  </Connection>
</ArrayOfConnection>
```

You can see a few "complex" objects, namely `HostDetails` and `MetaInformation`. The former is specific to the ***Host*** entry type, and the latter is a container for everything in the ***View*** – ***Asset*** section. Add the section name as a prefix to write to the inner fields.

```powershell
Foreach($row in $data)
{
  $session = $RDM.Add($row.Name)
  $session.Kind = "Host"
  $session.HostDetails.Host = $row.Name
  $session.MetaInformation.AssetSubType = "Desktop"
  $session.MetaInformation.IP = "10.10.1.25"
}
```

**Key points**

* Note that `Name` and `HostDetails.Host` properties share the same value. This is a characteristic of the ***Host*** entry, and caution must be taken when working with other entry types as well.
* Some fields, like `MetaInformation.AssetSubType` are tied to an enumeration and must contain the exact string. Some others like `MetaInformation.NetworkGateway` are simple strings and can contain anything. Feel free to contact our [support team](mailto:service@devolutions.net) if you have further questions.

### See also

* [Synchronizers](/rdm/concepts/advanced-concepts/synchronizers.md)
* [List of property names for PowerShell script](https://docs.devolutions.net/powershell/remote-desktop-manager-powershell/powershell-scripting/list-of-property-names-for-powershell-script)
* [PowerShell commands](https://docs.devolutions.net/powershell/powershell-commands)


---

# 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/rdm/knowledge-base/knowledge-base-articles/entry-settings/custom-powershell-synchronizer.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.
