From a2355c47515ca5fa9668dc0537f9f4c11b4db420 Mon Sep 17 00:00:00 2001 From: Neacail Grech Date: Wed, 17 Dec 2025 14:20:48 +0100 Subject: [PATCH 1/2] Update Publishing Sample --- Samples/PublishingSample.ps1 | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Samples/PublishingSample.ps1 b/Samples/PublishingSample.ps1 index dd8e735..48e4b7d 100644 --- a/Samples/PublishingSample.ps1 +++ b/Samples/PublishingSample.ps1 @@ -111,18 +111,13 @@ Set-RASPubRDSApp -InputObject $App_Sales -InheritShortcutDefaultSettings $false #Set AD account filters by ID. log "Set Active Directory filters for Accounts published desktop" -Set-RASCriteria -ObjType PubItem -InputObject $Desk_Sales -Enable $true -Replicate $true +Set-RASCriteria -ObjType PubItem -Id $Desk_Sales.Id -SecurityPrincipalsEnabled $true -RuleId 1 Add-RASCriteriaSecurityPrincipal -Account "Accounts" -SID "10" -Id $Desk_Acc.Id -ObjType PubItem -RuleId 1 -#Set AD account filters by object. -log "Set Active Directory filters for Sales published desktop" -Set-RASCriteria -InputObject $Desk_Sales -Enable $true -Replicate $true -Add-RASCriteriaSecurityPrincipal -InputObject $App_Acc -IP "10.0.0.1-10.0.0.12" - #Set an IP filter (with range) on application. log "Set IP filters for Accounts published application" -Set-RASCriteria -ObjType PubItem -InputObject $App_Acc -Enable $true -Add-RASCriteriaSecurityPrincipal -InputObject $App_Acc -IP "10.0.0.1-10.0.0.12" +Set-RASCriteria -ObjType PubItem -Id $App_Acc.Id -IPsEnabled $true -RuleId 1 +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. log "Appling settings" From d18ce32bed276a142a5888c48d52a7ac6190a609 Mon Sep 17 00:00:00 2001 From: Neacail Grech Date: Wed, 17 Dec 2025 14:28:50 +0100 Subject: [PATCH 2/2] Update Farm and RDSTemplate Samples --- Samples/FarmSample.ps1 | 6 +++--- Samples/PublishingSample.ps1 | 6 +++--- Samples/RDSTemplateSample.ps1 | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Samples/FarmSample.ps1 b/Samples/FarmSample.ps1 index e83ba7c..c109946 100644 --- a/Samples/FarmSample.ps1 +++ b/Samples/FarmSample.ps1 @@ -26,7 +26,7 @@ $RDSServer1 = "rds1.company.dom" #(replace 'rds1.company.dom' with a valid FQDN $RDSServer2 = "rds2.company.dom" #(replace 'rds2.company.dom' with a valid FQDN, computer name, or IP address). $RDSServer3 = "rds3.company.dom" #(replace 'rds3.company.dom' with a valid FQDN, computer name, or IP address). $RDS1Desc = "Updating RDS Host 1" #(replace with a more specific name). -$RDSGroupName = "My RDS Group" #(replace with a more specific name). +$RDSHostPoolName = "My RDS HP" #(replace with a more specific name). $RDSDefSettMaxSessions = 100 #(replace default value with preferred max sessions). $RDSDefSettAppMonitor = $true #(replace default value with preferred App Monitoring value (Enabeld/Disabled)). $PubDeskName = "PubDesktop" #(replace with a more specific name). @@ -73,7 +73,7 @@ Write-Host ($RDSList | Format-Table | Out-String) #Create an RD Session Host Group and add both RD Session Host objects to it. log "Add an RD Session host group (with list of RD Sessions)" -New-RASRDSHostPool -Name $RDSGroupName -RDSObject $RDSList +New-RASRDSHostPool -Name $RDSHostPoolName -RDSObject $RDSList #Add the third RD Session Host server. log "Adding the third RD Session Host server" @@ -81,7 +81,7 @@ $RDS3 = New-RASRDSHost -Server $RDSServer3 #Move the RD Session host to an existing RDS Group. log "Move the RD Session host to an existing RDS Group" -Move-RASRDSGroupMember -GroupName $RDSGroupName -RDSServer $RDS3.Server +Move-RASRDSHostPoolMember -HostPoolName $RDSHostPoolName -RDSServer $RDS3.Server #Update default settings used to configure RD Session Host agents. log "Updating RDS default settings" diff --git a/Samples/PublishingSample.ps1 b/Samples/PublishingSample.ps1 index 48e4b7d..e859d49 100644 --- a/Samples/PublishingSample.ps1 +++ b/Samples/PublishingSample.ps1 @@ -73,7 +73,7 @@ $RDSList = Get-RASRDSHost log "Print the list of RD Session servers retrieved" Write-Host ($RDSList | Format-Table | Out-String) -#Create an RD Session Host Group and add both RD Session Host objects to it. +#Create an RD Session Host Pool and add both RD Session Host objects to it. log "Add an RD Session host group (with list of RD Sessions)" New-RASRDSHostPool -Name $RDSGroupName -Description "RDSTemplates Pool" -WorkLoadThreshold 50 -ServersToAddPerRequest 2 ` -WorkLoadToDrain 20 -HostsToCreate 1 -HostName $VMNameFormat -MinServersFromTemplate 2 -MaxServersFromTemplate 2 -Autoscale $true -RDSObject $RDSList @@ -109,8 +109,8 @@ Set-RASPubRDSApp -InputObject $App_Sales -InheritShortcutDefaultSettings $false ###### PUB FILTERING CONFIGURATION ###### -#Set AD account filters by ID. -log "Set Active Directory filters for Accounts published desktop" +#Set Security Principal for Accounts published desktop by ID. +log "Set Security Principal for Accounts published desktop" Set-RASCriteria -ObjType PubItem -Id $Desk_Sales.Id -SecurityPrincipalsEnabled $true -RuleId 1 Add-RASCriteriaSecurityPrincipal -Account "Accounts" -SID "10" -Id $Desk_Acc.Id -ObjType PubItem -RuleId 1 diff --git a/Samples/RDSTemplateSample.ps1 b/Samples/RDSTemplateSample.ps1 index 61a58bc..bb6b461 100644 --- a/Samples/RDSTemplateSample.ps1 +++ b/Samples/RDSTemplateSample.ps1 @@ -54,7 +54,7 @@ New-RASSession #Add a Provider. log "Adding a new Provider" -$Provider = New-RASProvider -Server $VDIServer VMwareESXi -VmwareESXiVersion v6_5 -ProviderUsername root -ProviderPassword $AdminPassword -VDIAgent $VDIAgent -Username $AdminUsername -Password $AdminPassword +$Provider = New-RASProvider -VMwareESXi -VmwareESXiVersion v6_5 -Server $VDIServer -ProviderUsername root -ProviderPassword $AdminPassword -VDIAgent $VDIAgent -Username $AdminUsername -Password $AdminPassword #Apply all settings. This cmdlet performs the same action as the Apply button in the RAS console. log "Appling settings"