> For the complete documentation index, see [llms.txt](https://docs.parallels.com/landing/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.parallels.com/landing/ras-powershell-api-guide/rasadmin/cmdlets/get-rasrdsession.md).

# Get-RASRDSession

## SYNOPSIS

Retrieves information about one or multiple RD Sessions.

## SYNTAX

```powershell
Get-RASRDSession -ServerId <uint> -Source {RDS | VDI | AVD | All} [-GroupId <uint>]
 [-HostName <string>] [-IP <string>] [-SiteId <uint>]
 [-State {Active | Connected | ConnectQuery | Shadow | Disconnected | Idle | Listen | Reset | Down | Init | All}]
 [-ThemeId <uint>] [-User <string>] [<CommonParameters>]
```

```powershell
Get-RASRDSession -Server <string> -Source {RDS | VDI | AVD | All} [-GroupId <uint>]
 [-HostName <string>] [-IP <string>] [-SiteId <uint>]
 [-State {Active | Connected | ConnectQuery | Shadow | Disconnected | Idle | Listen | Reset | Down | Init | All}]
 [-ThemeId <uint>] [-User <string>] [<CommonParameters>]
```

```powershell
Get-RASRDSession [-GroupId <uint>] [-HostName <string>] [-IP <string>] [-SiteId <uint>]
 [-Source {RDS | VDI | AVD | All}]
 [-State {Active | Connected | ConnectQuery | Shadow | Disconnected | Idle | Listen | Reset | Down | Init | All}]
 [-ThemeId <uint>] [-User <string>] [<CommonParameters>]
```

## DESCRIPTION

Retrieves the information about one or multiple RD Sessions, from different sources such as RDS, VDI, and AVD.

## EXAMPLES

### Example 1

```powershell
Get-RASRDSession
```

Retrieves a list of RD Sessions.

### Example 2

```powershell
Get-RASRDSession -Source RDS
```

Retrieves a list of RDS Sessions.

### Example 3

```powershell
Get-RASRDSession -Source RDS -Server "MyServer"
```

Retrieves a list of RDS Sessions pertaining to the specified server.

### Example 4

```powershell
Get-RASRDSession -Source VDI -SiteId 1
```

Retrieves a list of VDI Sessions for SiteId 1.

### Example 5

```powershell
Get-RASRDSession -Source AVD -ServerId 1
```

Retrieves the AVD Session for ServerId 1.

### Example 6

```powershell
Get-RASRDSession -User "Administrator" -IP "1.1.1.1" -State Idle
```

Retrieves the Sessions with specified Username, IP and State.

## PARAMETERS

### -SiteId

Site ID from which to retrieve the Remote Desktop Session information (optional).

```yaml
Type: uint
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```

### -Source

Source from which to retrieve the Remote Desktop Session information.

Possible values: RDS, VDI, AVD, All

Type reference: [RDSessionSource](https://docs.parallels.com/landing/ras-powershell-api-guide/rasadmin/types/rdsessionsource.md)

```yaml
Type: RDSessionSource
Required: True
Position: Named
Default value: All
Accept pipeline input: False
Accept wildcard characters: False
```

### -ServerId

The Host ID of the server for which to retrieve the information (optional).

```yaml
Type: uint
Required: True
Position: Named
Default value: 4294967295
Accept pipeline input: False
Accept wildcard characters: False
```

### -Server

The name of the server to filter the Remote Desktop Session information (optional).

```yaml
Type: string
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -HostName

The name of the host to filter the AVD/VDI Remote Desktop Session information (optional).

```yaml
Type: string
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -State

State to filter the Remote Desktop Session information (optional).

Possible values: Active, Connected, ConnectQuery, Shadow, Disconnected, Idle, Listen, Reset, Down, Init, All

Type reference: [SessionState](https://docs.parallels.com/landing/ras-powershell-api-guide/rasadmin/types/sessionstate.md)

```yaml
Type: SessionState
Required: False
Position: Named
Default value: All
Accept pipeline input: False
Accept wildcard characters: False
```

### -User

User to filter the Remote Desktop Session information (optional).

```yaml
Type: string
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -IP

IP Address to filter the Remote Desktop Session information (optional).

```yaml
Type: string
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ThemeId

The Theme ID for which to retrieve the information (optional).

```yaml
Type: uint
Required: False
Position: Named
Default value: 4294967295
Accept pipeline input: False
Accept wildcard characters: False
```

### -GroupId

The RDS Group ID for which to retrieve the information (optional).

```yaml
Type: uint
Required: False
Position: Named
Default value: 4294967295
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

### None

## OUTPUTS

### [RDSession](https://docs.parallels.com/landing/ras-powershell-api-guide/rasadmin/types/rdsession.md)

## RELATED LINKS

* [Get-RASRDSHostStatus](https://docs.parallels.com/landing/ras-powershell-api-guide/rasadmin/cmdlets/get-rasrdshoststatus.md)
* [Get-RASProviderStatus](https://docs.parallels.com/landing/ras-powershell-api-guide/rasadmin/cmdlets/get-rasproviderstatus.md)
* [Invoke-RASRDSHostProcessCmd](https://docs.parallels.com/landing/ras-powershell-api-guide/rasadmin/cmdlets/invoke-rasrdshostprocesscmd.md)
* [Invoke-RASVDISessionCmd](https://docs.parallels.com/landing/ras-powershell-api-guide/rasadmin/cmdlets/invoke-rasvdisessioncmd.md)


---

# 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.parallels.com/landing/ras-powershell-api-guide/rasadmin/cmdlets/get-rasrdsession.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.
