> 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/v19/examples/rds-template-example.md).

# RDS Template Example

{% code fullWidth="true" %}

```powershell
#Establish a connection with Parallels RAS (Replace Administrator with your RAS root account). 
New-RASSession Administrator
###### VDI CONFIGURATION ######
#Add a Provider. 
$Provider = New-RASProvider -Server "vdi.company.dom" -VMwareESXi -VmwareESXiVersion v6_5 -VDIUsername root -VDIAgent "vdiagent.company.do" -Username root
#Apply settings for the Connection Broker to connect with the new VDI Host. 
Invoke-RASApply
#Get the list of Virtual Machines through the RAS Provider Agent 
Get-RASVM -ProviderId $Provider.Id

Name                 State    ID                                       Host ID  Site ID
----                 -----    --                                       -------  -------
WinSrv-2012R2        On       564d5e6f-3fad-bcf9-7c6b-bac9f212713d     1        1
					

#Convert the VM to an RDS Template 
$rdsTemplate = New-RASVDITemplate -ProviderId $Provider.Id -VMId 564d5e6f-3fad-bcf9-7c6b-bac9f212713d -Name Win11template -VMNameFormat Win11-%ID:3% -MaxVMs 5 -PreCreatedVMs 2 -VMsToCreate 1 -ImagePrepTool RASPrep -OwnerName Owner -Organization Parallels -Domain company.dom -Administrator Administrator -CloneMethod LinkedClone -TargetOU "OU=VDI,DC=dom,DC=company" -TemplateType RDSH -ComputerName "172.0.15.30"
#Apply settings to finalize RDS Template (and create any clones if required). 
Invoke-RASApply
###### RDSGROUP CONFIGURATION ######
#Create an RD Session Host Group and add RDS Template object to it. 
New-RASRDSGroup -Name "My RDS Group" -Description "RDSTemplates Group" -UseRASTemplate -RASTemplate $rdsTemplate -WorkLoadThreshold 50 -ServersToAddPerRequest 2 ` -MaxServersFromTemplate 2 -WorkLoadToDrain 20
#Apply all settings. This cmdlet performs the same action as the Apply button in the RAS console. Invoke-RASApply
#End the current RAS session. 
Remove-RASSession
```

{% endcode %}


---

# 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/v19/examples/rds-template-example.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.
