Parallels® Remote Application Server enables administrators to manage their Parallels RAS deployments using Microsoft PowerShell. The PowerShell module allows Parallels RAS administrators to automate various configuration operations and also create automatic scripts for repetitive and complex tasks.
First, we need to set up a connection with the RAS console and create a session.
Open Microsoft PowerShell and type in the Import-Module PSAdmin command and press enter.
Enter a secure password to be included when creating a new RAS session.
Type in the New-RASSession command followed by the –username “username” –password $securepassword and –server “Server IP Address”. Once all of the details have been entered, click the enter button to create the session.
Publishing Using Microsoft PowerShell
Get All Published Items
To get all published applications, first connect to the RAS console. After the session has been created, enter the Get-PubItem command to get all the published items.
To publish a new application using Microsoft PowerShell, you need to use the New-PubRDSApp command followed by the –Name “Application Name” –Target “the target of the application”. You can also add a description using –Description “adding the description of the application here”.
Once you have added the application, enter the Get-PubItem command to ensure that the application has been successfully added to the list of published items.
You can also filter the applications you get. If you enter the Get-PubRDSApp, only the items published using RDS will be shown.
To publish a desktop, first set up a connection and session with the RAS console as shown above. You can get all the published items using the Get-PubItem command to make sure the desktop has not been added yet.
To add a new RDS desktop to the list of published applications, enter the New-PubRDSDesktop command followed by the name you would like to give the desktop. To add the name, enter –Name “desktop name”.
Once the desktop has been added, enter the Get-PubItem command to make sure the new added desktop has also been added to the list of published applications.
Alternatively, you may also get the published RDS desktops only. To do so, enter the Get-PubRDSDesktop command.
Remove a Published Item
To remove a published item, first you need to connect and set up a session with the RAS console. Once the connection has been made, get all the published items by entering the Get-PubItem command.
Once you have the published items listed, you may proceed to remove a published item. Enter the Remove-PubItem command; the console will ask you to enter the ID for the application you would like to remove. Using the list of published applications we got before, check the ID of the published application and input the number. Then press enter to continue and remove the published item.
To make sure the published item has been removed, get all the published items again using the Get-PubItem command.
Terminal Services (RDS) Using Microsoft PowerShell
Retrieving All RDS Servers
The Get-RDS command retrieves information about one or multiple RD Session Host servers.
Connect to the RAS console and set up a session. Enter the Get-RDS command for Microsoft PowerShell to display all the Terminal Servers/RDS Servers added to the RAS console.
Adding a New RDS Server to the Farm
You can also add a new RDS/Terminal Server to the console using Microsoft PowerShell.
Set up a connection and session with the RAS console, then type in the New-RDS followed by the IP Address of the server in quotation marks. The new Terminal Server/RDS server will be automatically added. All the necessary components will be automatically pushed and installed remotely.
Once the TS/RDS server has been added, enter the Get-RDS command to confirm that the new server has been actually added.
Removing an RDS Server From the Farm
Using Microsoft PowerShell for RAS, you also have the ability to remove an RDS server without touching the console.
First, set up a connection and session with the RAS console, then retrieve all the currently added RDS severs by using the Get-RDS function. To remove an RDS server, input the Remove-RDS command and then enter the ID, which can be retrieved from the list acquired when using the Get-RDS function.
Once you see that the removal of the RDS server operation is successful, use the Get-RDS function again to confirm that you have actually removed the server.