# Invoke-RASVDISessionCmd

### NAME

Invoke-RASVDISessionCmd\ <br>

### SYNOPSIS

Sends VDI session commands.\ <br>

### SYNTAX

Invoke-RASVDISessionCmd \[-[InputObject](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/Invoke-RASVDISessionCmd.html#InputObject)] *<*[*VDIRDPSession*](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/types/VDIRDPSession.html)*>* -[Command](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/Invoke-RASVDISessionCmd.html#Command) {LogOff | SendMsg | Disconnect} \[-[Message](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/Invoke-RASVDISessionCmd.html#Message) *\<string>*] \[-[MsgTitle](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/Invoke-RASVDISessionCmd.html#MsgTitle) *\<string>*] \[*<*[*CommonParameters*](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/Invoke-RASVDISessionCmd.html#CommonParameters)*>*]\
\
Invoke-RASVDISessionCmd \[-[ProviderId](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/Invoke-RASVDISessionCmd.html#ProviderId)] *\<uint>* -[Command](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/Invoke-RASVDISessionCmd.html#Command) {LogOff | SendMsg | Disconnect} -[VDIHostId](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/Invoke-RASVDISessionCmd.html#VDIHostId) *\<string>* \[-[Message](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/Invoke-RASVDISessionCmd.html#Message) *\<string>*] \[-[MsgTitle](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/Invoke-RASVDISessionCmd.html#MsgTitle) *\<string>*] \[*<*[*CommonParameters*](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/Invoke-RASVDISessionCmd.html#CommonParameters)*>*]\
\
Invoke-RASVDISessionCmd \[-[VDIServer](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/Invoke-RASVDISessionCmd.html#VDIServer)] *\<string>* \[\[-[SiteId](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/Invoke-RASVDISessionCmd.html#SiteId)] *\<uint>*] -[Command](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/Invoke-RASVDISessionCmd.html#Command) {LogOff | SendMsg | Disconnect} -[VDIHostId](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/Invoke-RASVDISessionCmd.html#VDIHostId) *\<string>* \[-[Message](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/Invoke-RASVDISessionCmd.html#Message) *\<string>*] \[-[MsgTitle](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/Invoke-RASVDISessionCmd.html#MsgTitle) *\<string>*] \[*<*[*CommonParameters*](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/Invoke-RASVDISessionCmd.html#CommonParameters)*>*]\ <br>

### DESCRIPTION

Sends a session commands such as Logoff, Disconnect or send message.\
\
It will not fail unless VDI (server or Provider ID) is invalid or command does not reach the destination.\
\
If VDI Desktop ID is invalid, the command will not fail.\ <br>

### PARAMETERS

\
-**VDIServer \<string>**\
The name of a Provider.\
\
The name can be either FQDN or IP address, but you have to enter the actual name this server has in the RAS farm.\ <br>

```
        Required?                    true
```

```
        Position?                    0
```

```
        Default value                
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**SiteId \<uint>**\
Site ID from which to retrieve the server.\
\
If the parameter is omitted, the Licensing Server site ID will be used.\ <br>

```
        Required?                    false
```

```
        Position?                    1
```

```
        Default value                0
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**ProviderId \<uint>**\
The ID of the provider.\
\
To obtain the ID, use the Get-RASProvider cmdlet.\ <br>

```
        Required?                    true
```

```
        Position?                    0
```

```
        Default value                0
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**VDIHostId \<string>**\
Host ID.\
\
To obtain the HostId, use the Get-RASVDIHost command.\ <br>

```
        Required?                    true
```

```
        Position?                    named
```

```
        Default value                
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**InputObject <**[**VDIRDPSession**](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/types/VDIRDPSession.html)**>**\
The VDIRDPSession Object.\
\
To obtain a VDIRDPSession object representing an VDI Session, use the Get-RASProviderStatus command with StatusLevel as Level3."\ <br>

```
        Required?                    true
```

```
        Position?                    0
```

```
        Default value                
```

```
        Accept pipeline input?       true (ByValue)
```

```
        Accept wildcard characters?  false
```

\
-**Command <**[**VDISessionCmd**](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/types/VDISessionCmd.html)**>**\
Session Command.\
\
Accepted values: LogOff, SendMsg, Disconnect.\
\
Possible values: LogOff, SendMsg, Disconnect\ <br>

```
        Required?                    true
```

```
        Position?                    named
```

```
        Default value                0
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**MsgTitle \<string>**\
The message title for the session message.\ <br>

```
        Required?                    false
```

```
        Position?                    named
```

```
        Default value                
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**Message \<string>**\
The session message to be sent.\ <br>

```
        Required?                    false
```

```
        Position?                    named
```

```
        Default value                
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
\<CommonParameters>

```
        This cmdlet supports the common parameters: Verbose, Debug,
```

```
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
```

```
        OutBuffer, PipelineVariable, and OutVariable. For more information, see 
```

```
        about_CommonParameters . 
```

<br>

### INPUTS

[VDIRDPSession](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/types/VDIRDPSession.html)

### OUTPUTS

-none-

### EXAMPLES

\
\&#xNAN;**---------- EXAMPLE 1 ----------**\
\
Invoke-RASVDISessionCmd "server.company.dom" -Command LogOff -VDIDesktopId 42311235-09c5-ca15-337d-b9723015edf0\
\
Invoke the VDI session to send the LogOff command from the Licensing Server site (default).\
\&#xNAN;**---------- EXAMPLE 2 ----------**\
\
Invoke-RASVDISessionCmd -ProviderId 10 -Command SendMsg -VDIDesktopId 42311235-09c5-ca15-337d-b9723015edf0 -Message "This is a message"\
\
Invoke the VDI session to send the SendMsg command specified by ID.\
\
To obtain the ProviderId, use the Get-RASProvider cmdlet.\
\
To obtain the Desktop ID, use the Get-RASVDIDesktop cmdlet.\
\&#xNAN;**---------- EXAMPLE 3 ----------**\
\
$VDISession | Invoke-RASVDISessionCmd -Command Disconnect\
\
Invoke the VDI session to send the Disconnect command, which is identified by an object obtained from the pipeline output.\
\
To obtain the VDI Session, use the Get-RASProviderStatus cmdlet with StatusLevel as Level3.


---

# Agent Instructions: 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:

```
GET https://docs.parallels.com/landing/ras-powershell-api-guide/v19/parallels-ras-powershell-admin-module/commands/invoke-rasvdisessioncmd.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
