Publishing Example
#Establish a connection with Parallels RAS (NB. User will be prompted for Username and Password).
###### FARM CONFIGURATION ######
#Add two RD Session Host servers.
$RDS1 = New-RASRDSHost -Server "rds1.company.dom" $RDS2 = New-RASRDSHost -Server "rds2.company.dom"
#Get the list of RD Session Host servers.
$RDSList = Get-RASRDSHost
#Create an RD Session Host Pool and add both RD Session Host objects to it.
$RDSGrp = New-RASRDSHostPool -Name "My RDS Group" -Description "RDSTemplates Pool" -WorkLoadThreshold 50 -ServersToAddPerRequest 2 -WorkLoadToDrain 20 -HostsToCreate 1 -HostName "Win10-%ID:3%" -MinServersFromTemplate 2 -MaxServersFromTemplate 2 -Autoscale $true -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 -InheritShortcutDefaultSettings $false -CreateShortcutOnDesktop $false
###### PUB FILTERING CONFIGURATION ######
#Set AD account filters by ID.
Set-RASCriteria -ObjType PubItem -Id $Desk_Acc.Id -SecurityPrincipalsEnabled $true -RuleId 1 Add-RASCriteriaSecurityPrincipal -Account "Accounts" -SID "10" -Id $Desk_Acc.Id -ObjType PubItem -RuleId 1
#Enable IP filtering criteria on application.
Set-RASCriteria -ObjType PubItem -Id $App_Acc.Id -IPsEnabled $true -RuleId 1
#Set an IP filter (with range) on application.
Add-RASCriteriaIP -InputObject $App_Acc -IP "10.0.0.1-10.0.0.12" -IPType Version4 -RuleId 1
#Apply all settings. This cmdlet performs the same action as the Apply button in the RAS console.
#End the current RAS session.
© 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.
Last updated