> For the complete documentation index, see [llms.txt](https://docs.parallels.com/landing/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.parallels.com/landing/ras-admin-guide/v22-ja-jp/parallels-ras-no-api/ras-powershell-api.md).

# RAS PowerShell API

RAS PowerShell API は、RAS の管理を自動化することを希望する RAS 管理者向けに設計されています。この API には、RAS 管理タスクの大部分を実行するためのコマンドが含まれています。

### **Parallels RAS の要件**

Parallels RAS Windows PowerShell API のバージョンは、通信対象となる RAS Connection Broker のバージョンと一致している必要があります。これら 2 つのコンポーネントは個別にインストールできるため、バージョンが一致していることを確認する必要があります。

### **Microsoft Windows コンポーネントの要件**

Parallels RAS PowerShell コマンドレットを実行するコンピューターには、以下のコンポーネントがインストールされている必要があります。

* Windows PowerShell 3.0 以降
* Microsoft .NET Framework 4.5.2 以降

### **インストール**

Parallels RAS PowerShell をインストールするには、標準の Parallels RAS インストーラーを実行し、**カスタム インストール** を選択してから、**Parallels RAS PowerShell** コンポーネントのインストールを選択します。画面上の指示に従ってコンポーネントをインストールしてください。

### **RAS PowerShell API のバージョン**

Parallels RAS 18 では、RAS PowerShell API に以下の変更が加えられました：

* RAS PowerShell モジュール名が PSAdmin から RASAdmin に変更されました。
* ほとんどのコマンドに「RAS」という接頭辞が付くようになりました（例：RASGW、RASApply）。
* API バージョン：バージョン 2.0（最新）およびバージョン 1.0 が、後方互換対応のためにサポートされています。

なお、API バージョン 1.0 は現在の RAS PowerShell モジュールでも引き続き提供されます。古いモジュール名やコマンド名を使用している既存のスクリプトがある場合は、最小限の変更でそれらを引き続き使用できます。そのためには、RAS PowerShell モジュールをインポートする際に API バージョン 1.0 を読み込む必要があります。 API バージョンの詳細については、以下を参照してください。

**バージョン 2.0**

このバージョンは、システムによって既定では読み込まれ、モジュールをインポートする際に `-RequiredVersion` パラメーターが指定されていない場合にも読み込まれます。例については、**RAS Windows PowerShell API の概念**を参照してください。

**バージョン 1.0**

このバージョンは、古い PSAdmin モジュールとの下位互換性のある設計を採用しており、管理者は既存のスクリプトをわずかな変更で利用できます。このバージョンには以下が含まれます：

* コマンドレットのエイリアス
* エイリアス付きパラメーター
* 旧プロパティと新プロパティの両方を返す

### **RAS Windows PowerShell API の概念**

RAS PowerShell をすぐに使い始めるには、次の手順を実行してください。

1. Windows PowerShell コンソールを開きます。
2. 次のいずれかのコマンドを使用して、Parallels RAS PowerShell モジュールをインポートします。
   * `Import-Module RASAdmin —` 現在の API（バージョン 2.0）を読み込みます。
   * `Import-Module RASAdmin -RequiredVersion 1.0 —` API バージョン 1.0 を読み込みます。
3. `New-RASSession` コマンドレットを実行して、Parallels RAS セッションを作成します（以下の例を参照）。サーバー名（クォーティションで囲む）を、お使いの Parallels RAS ライセンスサーバーの名前または IP アドレスに置き換えてください。プロンプトが表示されたら、RAS 管理者ユーザー名とパスワードを入力します:

   `New-RASSession -Server "server.company.dom"`
4. 次のコマンドレットを実行して、Parallels RAS PowerShell モジュールに含まれるコマンドレットの一覧を表示します：

   `Get-Command -Module RASAdmin`
5. 他のコマンドレットを実行します。たとえば、`Get-RASW` コマンドレットを実行して、RAS セキュアゲートウェイに関する情報を取得してみてください。以下の例では、RAS ライセンスサーバー サイト内で利用可能なすべての RAS セキュアゲートウェイに関する情報が返されます：

   `Get-RASGW`
6. コマンドレットのヘルプを表示するには、コマンドレットの名前を引数として指定して `Get-Help` を実行します:

   `Get-Help Get-RASGW`
7. ファームのコンフィギュレーションに加えた変更を適用するには、`Invoke-RASApply` コマンドレットを使用します（これは、RAS コンソールの **適用** ボタンと同じ動作を行います）：

   `Invoke-RASApply`
8. Parallels RAS ライセンスを有効にするには、`Invoke-RASLicenseActivate` コマンドレットを使用します:

   `Invoke-RASLicenseActivate`

   上記のコマンドレットを実行すると、Parallels アカウントのインターネット電子メール アドレスとパスワードの入力を求められます。 オプションの `-Key` パラメーターを指定して、Parallels RAS ライセンスキーを指定することもできます。省略した場合（上記の例のように）、Parallels RAS は試用版としてライセンス認証を行います。

### **Parallels RAS Windows PowerShell ガイド**

新しい **Parallels RAS Windows PowerShell ガイド** バージョン 2.0 を閲覧およびダウンロードするには、Parallels のウェブサイト [https://www.parallels.com/products/ras/resources](https://www.parallels.com/products/ras/resources/) にアクセスしてください。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.parallels.com/landing/ras-admin-guide/v22-ja-jp/parallels-ras-no-api/ras-powershell-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
