> ## Documentation Index
> Fetch the complete documentation index at: https://kb.mspprocess.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Desktop agent

> An on-premises agent that lets Triggr workflows run PowerShell, such as Active Directory changes, in a client's network.

The desktop agent is a Windows service on a machine in a client's network. A workflow sends it PowerShell, it runs the script there and the output returns to the workflow.

<video controls preload="none" playsInline poster="/images/videos/desktop-agent.jpg" src="https://mintcdn.com/triggr/jthEaTOAfk2OUODQ/images/videos/desktop-agent.mp4?fit=max&auto=format&n=jthEaTOAfk2OUODQ&q=85&s=ba8562e14471c2a9b34134d7925c50fb" />

The desktop agent: what it does, what it needs and where it shows Online (1:29).

```mermaid theme={null}
flowchart LR
    T["Triggr cloud"] --> A["Desktop agent"] --> N["On-premises network"]
```

Use it for Active Directory work such as creating users, setting group memberships and disabling accounts, or any other PowerShell: files, registry and services. In Core, workflows such as User Onboarding make their Active Directory changes through the agent for clients whose Environment type is Cloud + On-Prem (synced).

## Requirements

* A Windows machine that's always on. The service runs as Local System, so for Active Directory changes install it on a domain controller, or change the service's Log On account to one with the rights your scripts need.
* Windows PowerShell 5.1 or PowerShell 7 (the agent uses PowerShell 7 when both are installed), plus any modules your scripts use, such as ActiveDirectory.
* Outbound HTTPS (port 443) to `api.triggr-app.com`. The agent only connects out, so it needs no inbound firewall rule. The install script also downloads the agent from `triggr-agent.s3.eu-west-2.amazonaws.com`.

Traffic is encrypted, each agent authenticates with credentials created for its client, and the scripts it runs are logged. A script can run for up to 10 minutes.

## Set it up

1. [Generate agent credentials](https://kb.mspprocess.com/desktop-agent/generate-credentials.md) for the client.
2. [Install the agent](https://kb.mspprocess.com/desktop-agent/install.md) on the machine.
3. Check the client shows the agent Online: under Agent Summary in Studio, or in the client's Agent section in Core. Online means it checked in within the last five minutes; after a day without contact it shows Offline.
4. In Studio, write a script and run it from a workflow: see [On-prem scripts](https://kb.mspprocess.com/studio/on-prem/scripts.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.