> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/platform/computers.md).

# Computers

Manage PowerShell Universal servers and Devolutions Agents, including static tags, computer groups, shared configuration, and maintenance mode.

> \[!NOTE] This feature requires a license. Each computer requires a license.

The **Manage > Computers & Groups > Computers** tab lists PowerShell Universal servers and connected Devolutions Agents. In a multi-node installation, jobs, computer groups, identities, and app tokens are stored in the shared database and are visible from every connected server.

## Connect PowerShell Universal servers

To add a server to an existing farm, configure it with the same SQL database connection string and Git repository. On startup, the server pulls the repository configuration and becomes available as a computer.

For Docker deployments, configure a stable `NodeName` in app settings. Containers otherwise receive a new computer name when they start, which can create unnecessary computer records.

## Devolutions Agents

Connected Devolutions Agents appear as **Agent** computers. Register and authenticate the agent as described in **Configuration > Agent**; PowerShell Universal creates or updates the computer record when the agent connects and marks it offline when the connection ends.

Agent computers report their version, online status, and connection machine name. Use computer groups to target supported jobs and schedules to selected agents or to a collection of agents with matching characteristics.

## Tags

Tags group computers by characteristics and determine computer-group membership. A computer group requires each configured tag value to be present on the computer.

### Server tags

PowerShell Universal detects tags such as domain, user name, and operating system. You can add static tags through **Manage > Computers & Groups > Computers** or configure them at startup. Startup tags are useful for Docker and other automated deployments because they do not require manual changes after a server starts.

Add tags in `appsettings.json`:

```json
{
  "Computer": {
    "Tags": [
      {
        "Name": "Region",
        "Value": "East"
      }
    ]
  }
}
```

Set the equivalent environment variables before starting PowerShell Universal:

```
Computer__Tags__0__Name=Region
Computer__Tags__0__Value=East
```

Configured tags are static and appear on the local server in **Manage > Computers & Groups > Computers**.

### Agent tags

When a Devolutions Agent registers, PowerShell Universal adds static tags from its registration information:

| Tag name         | Value                                 |
| ---------------- | ------------------------------------- |
| Type             | `Agent`                               |
| Machine Name     | The agent host name                   |
| Operating System | The reported operating system         |
| Architecture     | The reported processor architecture   |
| Hub              | Each reported Devolutions Gateway hub |
| Capability       | Each reported agent capability        |

These tags let you create groups based on the agent platform, hub, or available capability. They are managed by the agent registration and update as the agent reconnects.

## Computer groups

Computer groups contain computers that share required tag values. Create groups under **Manage > Computers & Groups > Groups** or with `New-PSUComputerGroup`.

For example, this group includes computers with the `windows` tag:

```powershell
New-PSUComputerGroup -Name 'Windows' -Tags @('windows')
```

Use agent tags to target all connected Devolutions Agents:

```powershell
New-PSUComputerGroup -Name 'Devolutions Agents' -Tags @('Agent')
```

After creating a group, restrict apps, APIs, scripts, schedules, and jobs to it. This app runs only on computers in the `Windows` group:

```powershell
New-PSUApp -Name 'Windows' -FilePath 'app.ps1' -BaseUrl '/app' -ComputerGroup 'Windows'
```

## Maintenance mode

Enable maintenance mode for a computer to prevent it from running scheduled jobs. Use this before servicing a server or taking an agent host offline.

### Set maintenance mode through the REST API

You can enter and leave maintenance mode directly through the Management API. A custom PowerShell endpoint is not required.

1. Authenticate with an app token that has **Computers > Read** permission to list computers and **Computers > Update** permission to change maintenance mode.
2. Call `GET /api/v1/computer` and identify the `id` of each computer you want to update.
3. Send `PUT /api/v1/computer?id=<id>&maintenance=true` to enter maintenance mode. Send the same request with `maintenance=false` to leave it.

Both values are query string parameters. No JSON request body is required. The request updates only the selected computer's maintenance flag; it does not create a computer or change its name, tags, connection settings, or other properties.

The following examples use an app token stored in the `PSU_APP_TOKEN` environment variable. Replace `https://psu.example.com` with your server URL and `1` with a computer ID returned by the list request.

List computers:

```bash
curl --fail-with-body \
  --header "Authorization: Bearer $PSU_APP_TOKEN" \
  "https://psu.example.com/api/v1/computer"
```

Enter maintenance mode:

```bash
curl --fail-with-body --request PUT \
  --header "Authorization: Bearer $PSU_APP_TOKEN" \
  "https://psu.example.com/api/v1/computer?id=1&maintenance=true"
```

Leave maintenance mode:

```bash
curl --fail-with-body --request PUT \
  --header "Authorization: Bearer $PSU_APP_TOKEN" \
  "https://psu.example.com/api/v1/computer?id=1&maintenance=false"
```

A successful update has no response body. Verify the stored state with `GET /api/v1/computer/1` and inspect `maintenance`. A missing computer returns `404 Not Found`. Requests without authentication return `401 Unauthorized`; authenticated callers without update permission receive `403 Forbidden`.

For a multi-node installation, repeat the update for every server computer ID. These requests read and write the shared database: enable maintenance **before** taking the database offline, and restore database connectivity **before** disabling maintenance. Maintenance mode is not an alternative to database availability.

### Set maintenance mode with PowerShell

The Universal module also supports maintenance mode:

```powershell
Get-PSUComputer -Id 1 | Set-PSUComputer -Maintenance $true
Get-PSUComputer -Id 1 | Set-PSUComputer -Maintenance $false
```

Connect the module to your server before running these commands. The PowerShell cmdlet is an alternative to the REST API, not a requirement for using maintenance mode.


---

# 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.devolutions.net/powershell-universal/platform/computers.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.
