# 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="https://1977539604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5qADNWBPym2Zh4ZaguCE%2Fuploads%2Fts0f1JZ3YKeRFtQPVVp8%2Fgpo.png?alt=media&#x26;token=d789abaf-7c47-4692-9acb-07d934da7bb3" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://1977539604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5qADNWBPym2Zh4ZaguCE%2Fuploads%2FJHVEUwAlqld61jaFevjQ%2FScreenshot%202026-02-18%20110425.png?alt=media&#x26;token=f5ffe9a3-9dd2-469e-a477-e47a6514cf7d" 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="https://1977539604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5qADNWBPym2Zh4ZaguCE%2Fuploads%2FYPwlh68o704nKTZoLE8t%2FScreenshot%202026-02-18%20113659.png?alt=media&#x26;token=e7358ad3-c982-4e0d-ad0d-4c097e14c4d2" alt=""><figcaption></figcaption></figure>

#### Triggers Tab

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

<figure><img src="https://1977539604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5qADNWBPym2Zh4ZaguCE%2Fuploads%2FDvSjDVMwWfMDCSyhSyUH%2FScreenshot%202026-02-18%20113757.png?alt=media&#x26;token=69e15b0a-d28b-4a73-8ba6-a07bcb78e897" 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="https://1977539604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5qADNWBPym2Zh4ZaguCE%2Fuploads%2FzdZi0SIqlEHcknwXS46o%2FScreenshot%202026-02-18%20114035.png?alt=media&#x26;token=2ad5292e-ca26-438c-800c-bbb6af76221d" 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="https://1977539604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5qADNWBPym2Zh4ZaguCE%2Fuploads%2F4IfP4J4XsRbytjjlOmnH%2FScreenshot%202026-02-18%20115307.png?alt=media&#x26;token=b7ea9fd0-ce30-46fa-b4cb-8e480fdb8f0c" 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 %}
