How to move all Published Items to a different RDS Group using PowerShell

0 users found this article helpful

Information

Execute the following script.

NOTE: RD Session Hosts group must exist. Script doesn't creates it.

############## Please change the following variables#########################
$SecretPassword = ConvertTo-SecureString "Your_RASAdmin_Password" -AsPlainText -Force
$Username = 'Your_RASAdmin_Username'
$NewGroup = Name_of_RDS_Group_you_would_like_to_use
$Server = 'IP_address_of_the_Publishing_Agent'
##############################################################################
Import-Module PSAdmin
New-RASSession -Username $Username -Password $SecretPassword -Server $Server
$Group = Get-RDSGroup -Name $NewGroup
$apps = Get-PubRDSApp
$desk = Get-PubRDSDesktop
 foreach ( $app in $apps)
{
 Set-PubRDSApp -Id $app.Id -PublishFrom Group -PublishFromGroup $Group
 
 }
  foreach ( $app in $Desk)
{
 Set-PubRDSDesktop -Id $app.Id -PublishFrom Group -PublishFromGroup $Group
 
 }
 
 Invoke-Apply

 

Was this article helpful?

Tell us how we can improve it.