> 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/v20/examples/farm.md).

# Farm Example

## Parallels RAS PowerShell - Farm Example

\#Establish a connection with Parallels RAS (Replace Administrator with\
your RAS root account).\
[New-RASSession](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/index.md#New-RASSession) Administrator

\#Add a RAS Secure Gateway (replace 'gw\.company.dom' with a valid FQDN,\
computer name, or IP address).\
[New-RASGateway](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/index.md#New-RASGateway) -Server\
"gw\.company.dom"

\#Add the first RD Session Host server (replace rds1.company.dom with a\
valid FQDN, computer name, or IP address).\
\#The $RDS1 variable receives an object of type RDS identifying the RD\
Session Host. $RDS1 = [New-RASRDS](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/index.md#New-RASRDS)\
-Server "rds1.company.dom"

\#Update the description of RD Session Host specified by the $RDS1\
variable. [Set-RASRDS](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/index.md#Set-RASRDS) -InputObject\
$RDS1 -Description "Updating RDS Host 1"

\#Add the second RD Session Host. $RDS2 =[New-RASRDS](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/index.md#New-RASRDS) -Server\
"rds2.company.dom"

\#Get the list of RD Session Host servers. The $RDSList variable\
receives an array of objects of type RDS. $RDSList =[Get-RASRDS](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/index.md#Get-RASRDS)

\#Create an RD Session Host Group and add both RD Session Host objects\
to it. [New-RASRDSGroup](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/index.md#New-RASRDSGroup) -Name\
"My RDS Group" -RDSObject $RDSList

\#Add the third RD Session Host server. $RDS3 =[New-RASRDS](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/index.md#New-RASRDS) -Server\
"rds3.company.dom"

\#Move RDS to RDS Group Member[Move-RASRDSGroupMember](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/index.md#Move-RASRDSGroupMember)\
-GroupName "My RDS Group" -RDSServer "rds3.company.dom"

\#Update default settings used to configure RD Session Host agents.\
[Set-RASRDSDefaultSettings](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/index.md#Set-RASRDSDefaultSettings)\
-MaxSessions 100 -EnableAppMonitoring $true

\#Add a published desktop.\
[New-RASPubRDSDesktop](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/index.md#New-RASPubRDSDesktop)\
-Name "PubDesktop\_1"

\#Activate Parallels RAS as a trial (you will have to provide a valid\
Parallels My Account email and password).\
[Invoke-RASLicenseActivate](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/index.md#Invoke-RASLicenseActivate)

\#Apply all settings. This cmdlet performs the same action as the Apply\
button in the RAS console.\
[Invoke-RASApply](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/index.md#Invoke-RASApply)

\#End the current RAS session.\
[Remove-RASSession](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/index.md#Remove-RASSession)

© 2025 Parallels International GmbH. Parallels and the Parallels logo\
are trademarks or registered trademarks of Parallels International GmbH\
in Canada, the U.S., and/or elsewhere.


---

# 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.parallels.com/landing/ras-powershell-api-guide/v20/examples/farm.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.
