> For the complete documentation index, see [llms.txt](https://docs.nexthink.com/platform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nexthink.com/platform/ja/user-guide/remote-actions/using-remote-actions/executing-remote-actions.md).

# リモートアクションを実行する

ユースケースに応じて、リモートアクション管理者はさまざまなリモートアクションのトリガーを設定する必要があります：

* **手動**​*​​*​\*??\*Wait keep markdown? It's text:**Manual** should be **手動**. Keep markdown.
* **スケジュール**
* **API**
* **Workflows**
* **Spark**

これらの設定により、従業員のデバイスでリモートアクションを実行する方法が決まります。

## リモートアクションの実行方法 <a href="#triggeringcampaigns-triggeringacampaignmanually" id="triggeringcampaigns-triggeringacampaignmanually"></a>

以下のセクションでは、リモートアクションを実行するすべての方法について説明します。

### リモートアクションを手動で実行する <a href="#managingremoteactions-executingremoteactionson-demand" id="managingremoteactions-executingremoteactionson-demand"></a>

対象のデバイスまたは VDI セッションに対して、Nexthink Web インターフェースからオンデマンドでリモートアクションを実行します。 ユースケースに応じて、リモートアクションは単一の対象に対して、または複数の対象に同時に実行できます。 以下のセクションでは、リモートアクションを手動でトリガーするために使用できる Nexthink の機能とインターフェイスについて説明します。

<details>

<summary>Investigations モジュールからリモートアクションを実行する</summary>

[Investigations](/platform/ja/user-guide/investigations.md) から：

1. [NQL エディター](/platform/ja/user-guide/investigations/creating-investigations/nql-editor.md)または[ビジュアルエディター](/platform/ja/user-guide/investigations/creating-investigations/visual-editor.md)を使用して、**デバイス**または **VDI セッション**のリストをクエリします
2. 調査結果テーブルから 1 台または複数のデバイスまたは VDI セッションを選択し、アクションバーの **アクションを実行** をクリックします。 **アクションの選択** ポップアップには、利用可能なアクションの一覧が表示されます。
   * セッションで実行できるのは、[VDI 用に構成されたリモートアクション](#targeting) のみです。
3. ロケットアイコンで識別できる目的のリモートアクションを選択し、選択したデバイスまたはセッションで実行します。
   * リモートアクションにパラメーターがある場合、確定する前に各パラメーターに値を入力する必要があります。
   * **実行先...** を選択します。
   * 検証メッセージにより、システムがリモートアクションをトリガーしたことが確認されます。
   * **結果を表示** をクリックして、リモートアクションの詳細ダッシュボードにアクセスします。

集計結果を伴う NQL クエリを使用して調査テーブルからリモートアクションを正しく実行するには、`device.collector.uid` で `summarize` するようにしてください。デバイス `name` で集計された結果からは、アクションを手動でトリガーできません。

以下に、手動でのリモートアクション実行に適した、出力を集計した NQL クエリの実例を示します：

```
devices during past 7D
| where (device.operating_system.platform == windows)
| where (remote_action.get_configuration_manager_sccm_client_status.execution.status == success and remote_action.get_configuration_manager_sccm_client_status.execution.outputs.ClientInstalled == false)
| summarize devices_without_SCCM_client_ = count() by device.collector.uid
| list device.collector.uid
```

<figure><img src="/files/vYbO3l6YnRCvFdGDbuF8" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
多数のデバイスでリモートアクションを実行する場合、ユーザーインターフェースに表示されるレコード数は 10,000 件に制限されるため、実行結果をエクスポートすることを Nexthink は推奨します。
{% endhint %}

</details>

<details>

<summary>デバイスビューまたはセッションビューからリモートアクションを実行する</summary>

[デバイスビュー](/platform/ja/user-guide/device-view.md)または[セッションビュー](/platform/ja/user-guide/vdi-experience/using-session-view.md)から：

1. ページ右側の **Actions** パネルを切り替えて、ユーザーロールで利用可能なすべてのリモートアクションとワークフローのリストを表示します。
2. リモートアクションを選択します：
   * リモートアクションにカーソルを合わせてアクションメニューを表示し、**Execute action** を選択して、選択したデバイスまたはセッションでリモートアクションを実行します。
   * **Yes** を選択して、リモートアクションの実行を確認します。
   * 検証メッセージにより、システムがリモートアクションをトリガーしたことが確認されます。
   * **View results** をクリックして、リモートアクションの詳細ダッシュボードにアクセスします。

<figure><img src="/files/wC3QR3XEG42upXCPxEty" alt=""><figcaption></figcaption></figure>

</details>

<details>

<summary>Amplify からリモートアクションを実行する</summary>

チケットを起票した従業員のデバイスを対象に、[Amplify](/platform/ja/user-guide/amplify.md) ウィンドウから直接リモートアクションを実行します。

* 該当するデバイスの Amplify で **Actions** タブを開きます。
  * **Checklist** タブに一覧表示される関連アクションも確認して選択できます。
* リモートアクションの詳細を展開すると、実行詳細をコピーするオプションを含め、リモートアクションの直近 2 件の実行ステータスを表示できます。
* **Run** を選択して、デバイス上でリモートアクションを実行します。
* **Yes** を選択して、リモートアクションの実行を確認します。
* 検証メッセージにより、システムがリモートアクションをトリガーしたことが確認されます。

</details>

<details>

<summary>リモートアクション管理ページからリモートアクションを実行する</summary>

リモートアクション管理ページからリモートアクションをトリガーしてテストします。 [リモートアクションを管理する](/platform/ja/user-guide/remote-actions/setting-up-and-managing-remote-actions/managing-remote-actions.md#executing-remote-actions-from-the-manage-remote-actions-page) ドキュメントを参照してください。

</details>

### リモートアクションのスケジュール設定 <a href="#triggeringcampaigns-triggeringascheduledcampaign" id="triggeringcampaigns-triggeringascheduledcampaign"></a>

スケジュールされたリモートアクションは、手動でトリガーする必要がありません。 スケジュールを設定すると、リモートアクションは定義したスケジュールに従って自動的に実行されます。

システムは、選択したスケジュールに基づいて定義済みの NQL クエリを評価し、結果として得られたデバイスまたはセッションにリモートアクションを送信します。

詳細については、[リモートアクションをスケジュールする](/platform/ja/user-guide/remote-actions/setting-up-and-managing-remote-actions/creating-remote-actions/scheduling-remote-actions.md) ドキュメンテーションを参照してください。

### API を使用したリモートアクションの実行 <a href="#triggeringcampaigns-triggeringacampaignusingtheapi" id="triggeringcampaigns-triggeringacampaignusingtheapi"></a>

Nexthink Remote Actions API を使用して、外部アプリケーションからリモートアクションをトリガーします。

詳細については、[Remote Action API](https://docs.nexthink.com/api/remote-actions) のドキュメントを参照してください。

### ワークフロー内でのリモートアクションの実行 <a href="#triggeringcampaigns-triggeringacampaignusingtheapi-1" id="triggeringcampaigns-triggeringacampaignusingtheapi-1"></a>

ワークフローでは、対象デバイスに関する追加の診断情報を収集したり、問題を修復したりするために、リモートアクションをトリガーできます。 返された出力値は、後続のワークフローステップまたは条件で使用できます。

詳細については、[リモートアクションシンクレット](/platform/ja/user-guide/workflows/creating-workflows/configuring-thinklets/remote-action-thinklet.md) を参照してください。

### Spark によるリモートアクションの実行 <a href="#triggeringcampaigns-triggeringacampaignmanually-1" id="triggeringcampaigns-triggeringacampaignmanually-1"></a>

Spark は、従業員とのやり取りから直接、診断と修復を自動化するためにリモートアクションを実行できます。 Spark で有効にすると、リモートアクションは、問題の解決、追加のデバイス情報の収集、またはセルフサービスエクスペリエンスのサポートに役立つ、Spark が実行可能な自動アクションとして利用できるようになります。

詳細については、[Spark アクションの管理](/platform/ja/user-guide/spark/setting-up-and-managing-spark/managing-agent-actions.md) を参照してください。

### 対話ユーザーに対するリモートアクションの実行

対話ユーザーとして実行されるリモートアクションでは、ユーザーがデバイスにログインしている必要があります。 Collector はユーザーがログインするまで待機し、その後にのみスクリプトを実行します。 実行は待機中、`waiting_on_user` ステータスとなり、リクエストの作成から一週間後に期限切れになります。

スクリプトは、リモートアクションがデバイスに到達した時点でログインしているユーザーのコンテキストで実行されます。 誰もログインしていない場合は、その後最初にログインしたユーザーに対して実行されます。 したがって、複数のユーザーで共有されているデバイスでは、実行ユーザーが意図したユーザーと異なる場合があります。

実行コンテキストの詳細については、[リモートアクションの作成と設定](/platform/ja/user-guide/remote-actions/setting-up-and-managing-remote-actions/creating-remote-actions.md#advanced-configuration)を参照してください。

<figure><img src="/files/J37mIVIYfxfCUheFFfLY" alt=""><figcaption></figcaption></figure>

### リモートアクションを実行したユーザーの特定

対話ユーザーによる実行では、デバイスを対象とするリモートアクションとセッションを対象とするリモートアクションの両方について、スクリプトを実行したユーザー名が報告されます。 そのユーザーを特定するには、`remote_action.executions` テーブルの `user.name` フィールドを一覧表示します：

```
remote_action.executions
| where remote_action.name == "Get OneDrive sync status"
| list device.name , user.name , status , remote_action.name
```

ユーザー名は、スクリプトの実行後にのみ表示されます。 ユーザーを待機中の実行、およびまったく実行されない実行では、ユーザー名は報告されません。

## リモートアクションのパラメーターの指定 <a href="#parametrized-campaigns" id="parametrized-campaigns"></a>

リモートアクションはパラメーター化できます。 このような場合、リモートアクションを手動でトリガーするユーザー、または API 呼び出しを介して実行するシステムは、必要な入力値を指定する必要があります。

詳細については、[リモートアクションの作成と設定](/platform/ja/user-guide/remote-actions/setting-up-and-managing-remote-actions/creating-remote-actions.md#parameters) を参照してください。

## Amplify からのリモートアクション実行の追跡 <a href="#managingremoteactions-trackingremoteactionexecutions" id="managingremoteactions-trackingremoteactionexecutions"></a>

Amplify からトリガーされたすべてのリモートアクションを追跡し、`remote_action.executions` テーブルのフィールドをフィルタリングします。 トリガーされたリモートアクションのデータにアクセスするには、NQL クエリにこれらのフィールドを含めます。

* `trigger_method`: リモートアクションの実行を開始するために使用されるトリガーモードです。
* `internal_source`: リモートアクションをトリガーするために使用された Nexthink モジュールです。
* `external_reference`: チケットを追跡するために使用される参照 ID です。
* `external_source`: リモートアクションが実行された外部 Web アプリケーションレコードの識別子です。

このテーブルは、`remote_action.executions` で実行された NQL クエリの結果に基づいて整理されます。

<figure><img src="/files/PxTNMxXQ4OfErGEReFuQ" alt="Tracking remote action execution"><figcaption></figcaption></figure>

### 例 1 <a href="#managingremoteactions-example1.1" id="managingremoteactions-example1.1"></a>

<details>

<summary>internal_source に基づいて、トリガーされたすべてのリモートアクションを返す NQL クエリ</summary>

```
remote_action.executions during past 7d
| where internal_source == "Amplify"
| list remote_action.name , device.name , time , trigger_method , status
```

</details>

### 例 2 <a href="#managingremoteactions-example2.1" id="managingremoteactions-example2.1"></a>

<details>

<summary>trigger_method に基づいて、トリガーされたすべてのリモートアクションを返す NQL クエリ。</summary>

```
remote_action.executions during past 7d
| where trigger_method == manual
| list remote_action.name , device.name , time , trigger_method , status
```

</details>

{% hint style="warning" %}
NQL のターゲティングクエリからリモートアクションを実行する場合、デバイスは `name` でターゲットにできないため、必ず `device UID` で集計してください。
{% endhint %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.nexthink.com/platform/ja/user-guide/remote-actions/using-remote-actions/executing-remote-actions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
