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 VDI Host servers. $VDIHost = New-VDIHost -Server "rds.company.dom" -VDIType VmwareESXi6_0 -VDIUsername root -VDIAgentOStype Appliance -VDIAgent "vdiagent.company.do" -Username root #Apply settings, for the Publishing Agent to connect with the new VDI Host. Invoke-Apply #Get the list of Virtual Machines through the RAS VDI Host Agent Get-VM -VDIHostId $VDIHost.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-VDIGuest -VDIHostId $VDIHost.Id -Id 564d5e6f-3fad-bcf9-7c6b-bac9f212713d -Username Administrator #Convert a VDIGuest to VDITemplate $vmTemplate = New-VDITemplate -VDIHostId $VDIHost.Id -VDIGuestId 564d5e6f-3fad-bcf9-7c6b-bac9f212713d -TemplateName Win8template -GuestNamePrefix Win8- -MaxGuests 5 -PreCreatedGuests 2 -ImagePrepTool RASPrep -OwnerName Owner -Organiz tion Parallels -JoinDomain 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-PubVDIDesktop-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-Apply #End the current RAS session. Remove-RASSession