# GPO Scheduled Task Setup

To enable **Startup Metrics**, the WSM Agent must run with elevated privileges. This requires configuring the agent to start as a **Scheduled Task at user logon** instead of launching from the Windows Startup folder.

### Create the Group Policy Object (GPO)

1. Open **Group Policy Management** (`gpmc.msc`).
2. Expand your domain.
3. Right-click the appropriate **Organisational Unit (OU)** containing the target users.
4. Select **Create a GPO in this domain, and Link it here**.
5. Provide a name for the GPO
6. Right-click the newly created GPO and select **Edit**.

<figure><img src="/files/66ZL83lfF7clRIMFmDXS" alt=""><figcaption></figcaption></figure>

Name the GPO **"WSMAgent"** or any other name that aligns with your organization's security standards.

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

### Configure the Scheduled Task

Navigate to:

```
User Configuration
 └─ Preferences
    └─ Control Panel Settings
       └─ Scheduled Tasks
```

Right-click in **Scheduled Tasks** → **New** → **Scheduled Task (At least Windows 7)**.

#### General Tab

Configure the following:

* **Name:** WSMAgent
* **Description:** (optional)
* **Run only when user is logged on:** Yes
* **Run with highest privileges:** Yes
* **Configure for:** Windows 10 / Windows Server 2016+

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

#### Triggers Tab

* **Begin the task:** At log on
* **Enabled:** Yes

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

#### Actions Tab

* **Action:** Start a program
* **Program/script:**

  ```
  C:\Program Files (x86)\Nuvens Consulting Ltd\WSM Agent\WsmAgent.exe
  ```

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

#### Settings Tab

* **Allow task to be run on demand**: Yes
* **If the task is already running**: Do not start a new instance
* **Stop the task if it runs longer than**: 3 days
* I**f the running task does not end when requested, force it to stop**: Yes

Click **OK** to save the task configuration.

<figure><img src="/files/6W5qMg7mrcPtxrfReiRc" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
The original shortcut used to start the agent from the Windows **Startup** folder must be removed.
{% endhint %}

{% hint style="warning" %}
A minimum of **one reboot** is required for the Group Policy to create the Scheduled Task. The agent will then start with elevated privileges at the next user logon.
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://docs.nuvens.cloud/install/appendices/gpo-scheduled-task-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
