Parallels RAS PowerShell - VDI Example

#Establish a connection with Parallels RAS (Replace Administrator with your RAS root account). New-RASSession Administrator
###### FARM CONFIGURATION ######
#Add a Provider. $Provider = New-RASProvider -Server "vdi.company.dom" -Type VmwareESXi6_0 -VDIUsername root -VDIAgent "vdiagent.company.do" -Username root
#Apply settings, for the Publishing Agent to connect with the new Provider. 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
	----             -----    --                                       -------  -------
	Windows 8        On       564d5e6f-3fad-bcf9-7c6b-bac9f212713d     1        1
						
#Convert a VM to VDI Guest New-RASVDIGuest -ProviderId $Provider.Id -Id 564d5e6f-3fad-bcf9-7c6b-bac9f212713d -Username Administrator
#Convert a VDIGuest to VDITemplate $vmTemplate = New-RASVDITemplate -Provider $Provider.Id -VDIGuestId 564d5e6f-3fad-bcf9-7c6b-bac9f212713d -Name Win8template -GuestNamePrefix Win8- -MaxGuests 5 -PreCreatedGuests 2 -ImagePrepTool RASPrep -OwnerName Owner -Organization Parallels -Domain company.dom -Administrator Administrator -CloneMethod LinkedClone -TargetOU "OU=VDI,DC=dom,DC=company"
###### PUBLISHING CONFIGURATION ######
#Add published desktop making use of the VDI Template. New-RASPubVDIDesktop -Name VDIDesktop -ConnectTo SpecificRASTemplate -VDITemplate $vmTemplate -Persistent $true
#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