RAS PowerShell API

RAS PowerShell API is intended for RAS administrators who would like to automate their RAS administration. The API includes commands to perform most of the RAS management tasks.

Parallels RAS requirements

The Parallels RAS PowerShell API version must match the version of the RAS Connection Broker with which it communicates. Since the two components can be installed separately, you need to make sure that their versions match.

Microsoft Windows component requirements

The following components must be installed on the computer where you'll be executing Parallels RAS PowerShell cmdlets:

  • Windows PowerShell 3.0 or higher

  • Microsoft .NET Framework 4.5.2 or higher

Installation

To install Parallels RAS PowerShell, run the standard Parallels RAS installer, choose Custom installation, and then select to install the Parallels RAS PowerShell component. Follow the onscreen instructions to install the component.

RAS PowerShell API versions

The RAS PowerShell API has undergone changes in Parallels RAS 18 as follows:

  • The RAS PowerShell module name has changed from PSAdmin to RASAdmin.

  • Most of the commands now have the "RAS" prefix, such as RASGW or RASApply.

  • API versions: Version 2.0 (latest) and version 1.0 are supported for backward compatibility.

Note that the API version 1.0 is still available in the current RAS PowerShell module. If you have existing scripts that use the older module and command names, you can use them with minimal changes. To do that, you need to load the API version 1.0 when you import the RAS PowerShell module. See below for more information about API versions.

Version 2.0

This version is the one loaded by default by the system or if the -RequiredVersion parameter is not specified when importing the module. See RAS PowerShell API concepts for examples.

Version 1.0

This version keeps backward compatible with the old PSAdmin module to allow administrators to use existing scripts with minor modification. This version includes:

  • Cmdlet aliases

  • Aliased parameters

  • Returns old and new properties

RAS PowerShell API concepts

To quickly get started with RAS PowerShell, do the following:

  1. Open the Windows PowerShell console.

  2. Import the Parallels RAS PowerShell module using one of the following commands:

    • Import-Module RASAdmin — Loads the current API (version 2.0).

    • Import-Module RASAdmin -RequiredVersion 1.0 — Loads the API version 1.0.

  3. Create a Parallels RAS session by executing the New-RASSession cmdlet (see example below). Substitute the server name (in quotes) with the name or IP address of your Parallels RAS Licensing Server. Type your RAS administrator username and password when prompted:

    New-RASSession -Server "server.company.dom"

  4. Execute the following cmdlet to see the list of cmdlets included in the Parallels RAS PowerShell module:

    Get-Command -Module RASAdmin

  5. Execute other cmdlets. For example, try executing the Get-RASW cmdlet to retrieve information about RAS Secure Gateway(s). The example below returns information about all RAS Secure Gateways available in the RAS Licensing Server Site:

    Get-RASGW

  6. To see help for a cmdlet, execute Get-Help passing a cmdlet name:

    Get-Help Get-RASGW

  7. To apply changes you've made to the Farm configuration, use the Invoke-RASApply cmdlet (this performs the same action as the Apply button in the RAS Console):

    Invoke-RASApply

  8. To activate a Parallels RAS license, use the Invoke-RASLicenseActivate cmdlet:

    Invoke-RASLicenseActivate

    When executing the cmdlet above, you'll be prompted to enter your Parallels account email address and password. You can include an optional -Key parameter and specify a Parallels RAS license key. If omitted (as in the example above), Parallels RAS is activated as a trial.

Parallels RAS PowerShell Guide

To view and download the new Parallels RAS PowerShell Guide version 2.0, visit Parallels website at https://www.parallels.com/products/ras/resources.

Last updated

© 2024 Parallels International GmbH. All rights reserved.