> 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/send-rdmmessage.md).

# Send-RDMMessage

### Synopsis

Write a new secure message.

### Syntax

#### NewMessage (Default)

```
Send-RDMMessage [-To] <PSBasicUserWrapper[]> [-Subject] <string> [[-Body] <string>]
 [-Attachment <Object[]>] [-CaseSensitive] [-ExpiresIn <int>] [-ExpiresOn <datetime>]
 [-ForcePromptAnswer <DialogResult[]>] [<CommonParameters>]
```

#### Reply

```
Send-RDMMessage [-ReplyTo] <DataSourceMessage> [[-Body] <string>] [-Subject <string>]
 [-Attachment <Object[]>] [-CaseSensitive] [-ExpiresIn <int>] [-ExpiresOn <datetime>]
 [-ForcePromptAnswer <DialogResult[]>] [<CommonParameters>]
```

### Description

Write a message. The workspace must be a Devolutions Server or Devolutions Cloud.

### Examples

#### Example 1

```powershell
PS C:\> Send-RDMMessage 'FirstName LastName' 'ASubject' 'AMessage'
```

Send a secure message to 'FirstName LastName' about 'ASubject'. The detail of the message is 'AMessage'.

#### Example 2

```powershell
PS C:\> $entryA = Get-RDMPrivateSession -Name 'entryA'; $file = New-RDMMessageAttachment -File -Path "C:\mypath\filename.extension"; Send-RDMMessage -To 'Person A', 'Person B' -Subject 'Why' -Body 'AMessage' -Attachment $entryA, $file
```

Fetch a private entry and create a file attachment. Send a secure message to Person A and Person B about 'Why'. The detail of the message is 'AMessage' and two attachments, 'entryA' and the file, are attached.

#### Example 3

```powershell
PS C:\> Receive-RDMMessage -From 'First Last' -SentOn Today -Subject 'Required Connection'| Send-RDMMessage -Body 'Thank you'
```

Send a reply to the message 'First Last' sent today about 'Required Connection' to thank him. The subject will be 'Re: Required Connection' and the body, 'Thank you'

#### Example 4

```powershell
PS C:\> Send-RDMMessage -To 'person A' -Subject 'ASubject' -Attachment 'anEntry' -CaseSensitive
```

Send a message to 'person A' with the attachment 'anEntry'. The user Person A won't be found.

#### Example 5

```powershell
PS C:\> $entry = Get-RDMPrivateSession -Name AnEntry; Send-RDMMessage -To 'Person A' -Subject 'ASubject' -Attachment $entry
```

Fetch a private entry with the cmdlet Get-RDMPrivateSession. It is pointless to modify the stored entry because it will be fetched by its ID. After that, a message will be sent to Person A with the attachment AnEntry.

### Parameters

#### -Attachment

Attachments to add to the message. The supported types are PSMessageAttachment and PSConnection.

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

#### -Body

Body text of the message.

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

#### -CaseSensitive

The value passed for the user will be case sensitive.

```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: ''
```

#### -ExpiresIn

Number of days before the message expires.

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

#### -ExpiresOn

Date when the message will expire.

```yaml
Type: System.Nullable`1[System.DateTime]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
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: ''
```

#### -ReplyTo

The subject and a recipient will be added based on the message. The subject can be modified with the Subject parameter.

```yaml
Type: Devolutions.RemoteDesktopManager.Business.Messages.DataSourceMessage
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Reply
  Position: 0
  IsRequired: true
  ValueFromPipeline: true
  ValueFromPipelineByPropertyName: true
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -Subject

Subject of the message.

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

#### -To

The recepients of the message. They can be identified by ID, name, email, or by their PSUserInfo.

```yaml
Type: RemoteDesktopManager.PowerShellModule.PSOutputObject.PSWrapper.PSBasicUserWrapper[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: NewMessage
  Position: 0
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: true
  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

#### Devolutions.RemoteDesktopManager.Business.Messages.DataSourceMessage

The message obtained from the Receive-RDMMessage can be piped to the parameter ReplyTo.

### Notes

For more information, type "Get-Help Send-RDMMessage -detailed". For technical information, type "Get-Help Send-RDMMessage -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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.devolutions.net/powershell/powershell-commands/send-rdmmessage.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
