Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
#Establish a connection with Parallels RAS (Replace Administrator with your RAS root account). New-RASSession Administrator
#Add a RAS Secure Gateway (replace 'gw.company.dom' with a valid FQDN, computername, or IP address). New-RASGateway -Server "gw.company.dom"
#Add an RD Session Host server (replace 'rds.company.dom' with a valid FQDN, computer name, or IP address). New-RASRDS -Server "rds.company.dom"
#Add a published desktop. New-RASPubRDSDesktop -Name "PubDesktop"
#Activate Parallels RAS as a trial (you will have to provide a valid Parallels My Account email and password). Invoke-RASLicenseActivate
#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
© 2024 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.
#Establish a connection with Parallels RAS (Replace Administrator with your RAS root account). New-RASSession Administrator
#Adding two RAS RDSs New-RASRDS -Server "rds1.company.dom" -Username administrator New-RASRDS -Server "rds2.company.dom" -Username administrator
#Apply all settings. This cmdlet performs the same action as the Apply button in the RAS console. Invoke-RASApply
# Get all available RAS Agents information Get-RASAgent
# Get the RAS Agent information (by server name 'rds1.company.dom') Get-RASAgent -Server rds1.company.dom | Format-Table
#Update RDS RAS Agent (by input object) $rdsAgent = Get-RASAgent -Server rds1.company.dom Update-RASAgent -InputObject $rdsAgent -Username administrator
#Update RDS RAS Agent (by server name 'rds2.company.dom') Update-RASAgent -Server rds2.company.dom -Username administrator
# Get all RAS Agents information of type RDS Get-RASAgent -ServerType RDS | Format-Table
# Removing RAS Agent (by server name 'rds2.company.dom') Remove-RASAgent -Server rds2.company.dom -Username administrator
#Apply all settings. This cmdlet performs the same action as the Apply button in the RAS console. Invoke-RASApply
# Get all available RAS Agents information Get-RASAgent
#End the current RAS session. Remove-RASSession
© 2024 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.
#Establish a connection with Parallels RAS (Replace Administrator with your RAS root account). New-RASSession Administrator
###### FARM CONFIGURATION ######
#Activate Parallels RAS with a valid key (you will have to provide a valid Parallels My Account password). Invoke-RASLicenseActivate -Email "myaccount@email.com" -Key "YOUR-LICENSE-KEY"
#Add the backup Connection Broker server. New-RASBroker -Server broker.company.dom
#Apply all settings. This cmdlet performs the same action as the Apply button in the RAS console. Invoke-RASApply
#Get the list of connection Brokers. Get-RASBroker
#End the current RAS session. Remove-RASSession
###### END FARM CONFIGURATION ######
###### TESTING CONNECTION BROKER PROMOTION ######
#Establish a connection with Parallels RAS (Replace Administrator with your RAS root account). New-RASSession Administrator -Server "broker.company.dom" -Force
#Get the backup Broker server. $BackupBroker = Get-RASBroker -Server broker.company.dom
#Promote backup Broker to primary (you will have to provide a valid Parallels My Account password). Invoke-RASBrokerPromoteToPrimary -Id $BackupBroker.Id -Email "myaccount@email.com"
#After the Broker promotion to Primary the session is logged out, then a new session needs to be created. Establish a connection with Parallels RAS (Replace Administrator with your RAS root account). New-RASSession Administrator -Server "broker.company.dom" -Force
#Apply all settings. This cmdlet performs the same action as the Apply button in the RAS console. Invoke-RASApply
#Get the list of Connection Brokers. Get-RASBroker
#End the current RAS session. Remove-RASSession
###### END TESTING CONNECTION BROKER PROMOTION ######
© 2024 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.
#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
#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
© 2024 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.
This section is organized into the following sub-sections:
Basic Example demonstrates how to start a session, add major objects to a site, publish a desktop, activate a license, apply the changes, and finally end the session.
Farm Example expands the basic example and shows how to modify objects, handle multiple objects and groups, and manage default settings.
Publishing Example demonstrates how to manage published resources and use filtering options.
VDI Example demonstrates how to add a Provider, and publish a desktop from a VDI Template.
Status Info Example demonstrates how to retrieve status information of an RDS, Gateway, Broker, Site and Provider.
RAS Agent Example demonstrates how to manage RAS Agent operations.
RDS Template Example demonstrates how to add an RDS Template and use it in an RDS Group.
Connection Broker Promote Example demonstrates how to promote a backup Connection Broker (Broker) when the primary Connection Broker is down.
You can find more scripts and examples from Parallels and RAS Community on GitHub.
© 2024 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.
#Establish a connection with Parallels RAS (Replace Administrator with your RAS root account). New-RASSession Administrator
#Add a RAS Secure Gateway (replace 'gw.company.dom' with a valid FQDN, computer name, or IP address). 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 -Server "rds1.company.dom"
#Update the description of RD Session Host specified by the $RDS1 variable. Set-RASRDS -InputObject $RDS1 -Description "Updating RDS Host 1"
#Add the second RD Session Host. $RDS2 = 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
#Create an RD Session Host Group and add both RD Session Host objects to it. New-RASRDSGroup -Name "My RDS Group" -RDSObject $RDSList
#Add the third RD Session Host server. $RDS3 = New-RASRDS -Server "rds3.company.dom"
#Move RDS to RDS Group Member Move-RASRDSGroupMember -GroupName "My RDS Group" -RDSServer "rds3.company.dom"
#Update default settings used to configure RD Session Host agents. Set-RASRDSDefaultSettings -MaxSessions 100 -EnableAppMonitoring $true
#Add a published desktop. 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
#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
© 2024 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.
#Establish a connection with Parallels RAS (Replace Administrator with your RAS root account). New-RASSession Administrator
###### RDS status info ######
#Adding a RAS RDS New-RASRDS -Server "rds.company.dom" -Username administrator
#Apply all settings. This cmdlet performs the same action as the Apply button in the RAS console. Invoke-RASApply
# Get RDS status info Get-RASRDSStatus -Server rds.company.dom
###### Gateway status info ######
#Adding a RAS Gateway New-RASGateway -Server "gw.company.dom" -Username administrator
#Apply all settings. This cmdlet performs the same action as the Apply button in the RAS console. Invoke-RASApply
# Get Gateway status info Get-RASGatewayStatus -Server gw.company.dom
###### Connection Broker status info ######
#Adding a RAS Connection Broker New-RASBroker -Server "broker.company.dom" -Username administrator
#Apply all settings. This cmdlet performs the same action as the Apply button in the RAS console. Invoke-RASApply
# Get Connection Broker status info Get-RASBrokerStatus -Server broker.company.dom
###### Site status info ######
#Adding a RAS Site New-RASSite -Server "site.company.dom" -Name "MySite" -Username administrator
#Apply all settings. This cmdlet performs the same action as the Apply button in the RAS console. Invoke-RASApply
# Get Site status info Get-RASSiteStatus -Server site.company.dom
###### Provider status info ######
#Add a Provider servers. $Provider = New-RASProvider -Server "vdi.company.dom" -VMwareESXi -VmwareESXiVersion v6_5 -VDIUsername root -VDIAgent "vdiagent.company.do" -Username root
#Apply all settings. This cmdlet performs the same action as the Apply button in the RAS console. Invoke-RASApply
# Get Provider status info Get-RASProviderStatus -Id $Provider.Id
#End the current RAS session. Remove-RASSession
© 2024 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.
#Establish a connection with Parallels RAS (Replace Administrator with your RAS root account). Administrator
###### FARM CONFIGURATION ######
#Add a Provider. $Provider = -Server "vdi.company.dom" -VMwareESXi -VmwareESXiVersion v6_5 -VDIUsername root -VDIAgent"vdiagent.company.do" -Username root
#Apply settings, for the Publishing Agent to connect with the new Provider.
#Get the list of Virtual Machines through the RAS Provider Agent -ProviderId $Provider.Id
#Create a new VDI Template (Guest Automatically Installed) $vmTemplate = -Provider $Provider.Id -VMId 564d5e6f-3fad-bcf9-7c6b-bac9f212713d -Name Win10template -VMNameFormat Win10-%ID:3% -MaxVMs 5 -PreCreatedVMs 2 -ImagePrepTool RASPrep -OwnerName Owner -Organization Parallels -Domain company.dom -Administrator Administrator -CloneMethod LinkedClone -TargetOU "OU=VDI,DC=dom,DC=company"
#Add a VDI Pool $VDIPool = -Name "VDIPool"
#Add a VDI Pool Member -VDIPoolId $VDIPool.Id -Type TEMPLATEGUEST -Name $vmTemplate.Name -VDITemplateId $vmTemplate.Id
###### PUBLISHING CONFIGURATION ######
#Add published desktop making use of the VDI Template. -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.
#End the current RAS session.
© 2024 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.
#Establish a connection with Parallels RAS (Replace Administrator with your RAS root account). New-RASSession Administrator
###### FARM CONFIGURATION ######
#Add two RD Session Host servers. $RDS1 = New-RASRDS -Server "rds1.company.dom" $RDS2 = New-RASRDS -Server "rds2.company.dom"
#Get the list of RD Session Host servers. $RDSList = Get-RASRDS
#Create a RAS RD Session Host group and add both RDS objects to it. $RDSGrp = New-RASRDSGroup -Name "My RDS Group" -RDSObject $RDSList
#Update default settings used to configure RD Session Host agents. Set-RASRDSDefaultSettings -MaxSessions 100 -EnableAppMonitoring $true
###### PUBLISHING CONFIGURATION ######
#Add published folders to be used by different departments. $Fld_Acc = New-RASPubFolder -Name "AccDept" -Description "Accounting" $Fld_Sales = New-RASPubFolder -Name "SalesDept" -Description "Sales"
#Add published desktops within their respective folders. $Desk_Acc = New-RASPubRDSDesktop -Name "AccPubDesktop" -ParentFolder $Fld_Acc -DesktopSize FullScreen -PublishFrom Group -PublishFromGroup $RDSGrp $Desk_Sales = New-RASPubRDSDesktop -Name "SalesPubDesktop" -ParentFolder $Fld_Sales -DesktopSize Custom -Width 600 -Height 400 -PublishFrom All
#Add published applications within their respective folders. $App_Acc = New-RASPubRDSApp -Name "AccPubApp" -Target "C:\Windows\System32\calc.exe" -ParentFolder $Fld_Acc -PublishFrom All -WinType Maximized -StartOnLogon $App_Sales = New-RASPubRDSApp -Name "SalesPubApp" -Target "C:\Windows\System32\notepad.exe" -ParentFolder $Fld_Sales -PublishFrom Server -PublishFromServer $RDS1
#Update default settings used to configure published resources. Set-RASPubDefaultSettings -CreateShortcutOnDesktop $true
#Override shortcut default settings for a specific published application. Set-RASPubRDSApp -InputObject $App_Sales -InheritShorcutDefaultSettings $false -CreateShortcutOnDesktop $false
###### PUB FILTERING CONFIGURATION ######
#Set AD account filters by ID. Add-RASRule -Id $Desk_Acc.Id -ObjType PubItem -RuleName "Rule 1" $Desk_Acc_Rules = Get-RASRule -Id $Desk_Acc.Id -ObjType PubItem Set-RASCriteria -Id $Desk_Acc.Id -ObjType PubItem -SecurityPrincipalsEnabled $true -RuleId $Desk_Acc_Rules[0].Id Add-RASCriteriaSecurityPrincipal -Id $Desk_Acc.Id -ObjType PubItem -RuleId $Desk_Acc_Rules[0].Id -Account "Guests"
#Set AD account filters by object. Add-RASCriteriaSecurityPrincipal -Id $Desk_Acc.Id -ObjType PubItem -RuleId $Desk_Acc_Rules[0].Id -SID "S-1-5-11"
#Set an IP filter (with range) on application. Add-RASRule -InputObject $App_Acc -RuleName "Rule 1" $App_Acc_Rules = Get-RASRule -Id $App_Acc.Id -ObjType PubItem Set-RASCriteria -InputObject $App_Acc -RuleId $App_Acc_Rules[0].Id -IPsEnabled $true Add-RASCriteriaIP -InputObject $App_Acc -RuleId $App_Acc_Rules[0].Id -IPType Version4 -IP "10.0.0.1-10.0.0.12"
#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
© 2024 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.