# RDS Template Example

## Parallels RAS PowerShell - RDS Template Example

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

\###### VDI CONFIGURATION ######

\#Add a Provider. $Provider = [New-RASProvider](https://docs.parallels.com/landing/ras-powershell-api-guide/parallels-ras-powershell-admin-module/index#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](https://docs.parallels.com/landing/ras-powershell-api-guide/parallels-ras-powershell-admin-module/index#Invoke-RASApply)

\#Get the list of Virtual Machines through the RAS Provider Agent [Get-RASVM](https://docs.parallels.com/landing/ras-powershell-api-guide/parallels-ras-powershell-admin-module/index#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](https://docs.parallels.com/landing/ras-powershell-api-guide/parallels-ras-powershell-admin-module/index#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](https://docs.parallels.com/landing/ras-powershell-api-guide/parallels-ras-powershell-admin-module/index#Invoke-RASApply)

\###### RDSGROUP CONFIGURATION ######

\#Create an RD Session Host Group and add RDS Template object to it.\
[New-RASRDSGroup](https://docs.parallels.com/landing/ras-powershell-api-guide/parallels-ras-powershell-admin-module/index#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](https://docs.parallels.com/landing/ras-powershell-api-guide/parallels-ras-powershell-admin-module/index#Invoke-RASApply)

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

© 2026 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.
