Restarting Computers

Patches, firmware changes and stuck machines all end the same way: the computer needs a restart. Athena has a built-in Restart computer action. It restarts one Windows device, a selection from the Agents list, or every member of a collection, after a delay you choose. Anyone signed in to the device gets a Windows warning first. You don't write a script for it, and you don't need the right to run arbitrary commands.

Windows only, online agents only

A restart can only be sent to a Windows agent that is connected right now. Linux agents are reported as not supported. Offline agents are reported as offline. Neither gets a restart, and Athena does not queue one for when an offline device comes back.

To restart machines that are waiting for a restart automatically, inside maintenance windows and with a deadline, on Windows, Linux and macOS, use Restart Policies.

Where to find it#

The same action, with the same confirmation dialog, appears in four places:

LocationControlWhat it restarts
Agent Details headerIcon button next to the other agent actions (tooltip: Restart this computer after a delay - the logged-on user is warned)That one device.
Agents listRestart (N) in the toolbar. It appears once you tick one or more agents in the checkbox column.The ticked agents. The selection is cleared after the request goes out.
Collection details pageRestart computersEvery current member of the collection. The button is disabled when the collection has no members.
Boot & Security section of Agent DetailsRestart computer next to the Secure Boot certificate card's Pending restart stateThat one device. The button only appears while the certificate update is waiting for a restart.

The buttons only appear for accounts that hold the agents.restart permission (see Permissions). The permission is checked again when you confirm, so a button left open in an old browser tab can't get around it.

The confirmation dialog#

Every restart goes through a Restart computer confirmation. It names the target (a hostname, or "N computers") and warns that anyone signed in sees a Windows warning with the delay, that unsaved work is lost, and that the action is Windows only.

FieldValuesNotes
Restart in (seconds)Whole number from 0 to 3600. Default 60.0 restarts immediately. 3600 (one hour) is the maximum. Outside that range, the Restart button stays disabled and the dialog shows Enter a whole number of seconds from 0 to 3600.

In a bulk request (the Agents list or a collection), every device gets the same delay. The delay is the only thing you can set. You cannot change the command Athena runs or the message the user sees.

What happens on the device#

Athena sends the restart as a normal remote command. It runs as SYSTEM, and the command itself is fixed:

shutdown.exe /r /t <seconds> /c "<notice>"

The notice shown to the signed-in user is also fixed. It depends only on the delay:

DelayWindows warning text
0Athena: an administrator is restarting this computer now.
1–3600Athena: an administrator will restart this computer in N seconds. Save your work.

All the selected devices go into one command, so the restart appears in the command history like any other command. It is recorded under your user name, and you can see the result for each device there.

Inventory refreshes by itself afterwards. When a device that was sent a restart reconnects, Athena asks it once for a full inventory collection. Views that depend on a reboot then update without you doing anything, for example the Secure Boot certificate card's Pending restart state or the Restart Pending flag. That follow-up collection is recorded as requested by System (after restart).

Outcomes per device#

Each device in a request gets one of these outcomes:

OutcomeMeaningConsole message (single device)
DispatchedThe restart command was sent to the device.Restart sent - the computer restarts in N seconds
OfflineThe agent is not connected. Nothing was sent.The computer is offline - no restart was sent
NotSupportedThe agent isn't a Windows agent. Nothing was sent.Restart is Windows-only for now - nothing was sent
NotFoundNo agent with that ID exists (for example, it was removed).The agent no longer exists - nothing was sent
FailedAthena could not create or send the command.The restart could not be sent

For a bulk request, the console shows one summary instead: Restart sent to X of Y computers (A offline, B not Windows). It is a success message if at least one device was sent the restart, and a warning if none were.

Devices in maintenance mode are not restarted

The restart travels as a remote command, so it follows the same maintenance mode rule as every other command. A connected device in maintenance mode can still show Dispatched, but the command skips it. The device's result in the command history shows Skipped with Agent in Maintenance Mode. To restart a device you are servicing, take it out of maintenance mode first.

Cancelling a pending restart#

Athena has no "cancel restart" button. While the delay is still counting down, you can abort the restart by running this Windows command on the device as a remote command (this needs commands.execute):

shutdown /a

If you cancel, the device doesn't drop its connection, so the automatic inventory refresh doesn't run straight away. It runs the next time that device reconnects to the server.

Permissions#

Restarting has its own permission, agents.restart: Restart a device (Windows), after a delay the operator chooses and the logged-on user is told about. Out of the box, Operator and Admin hold it. User and Helpdesk do not. Athena runs a fixed command for you, so restarting does not need commands.execute. You can let operators restart machines without also letting them run any script they like. See Permission Model & Role Bundles.

Without the permission, the restart buttons are hidden and both REST endpoints return 403.

REST API#

Method & pathPermissionPurpose
POST /api/agents/{id}/restartagents.restartRestart one device. The body is optional. An empty body uses the default 60-second delay.
POST /api/agents/restartagents.restartRestart many devices with one delay. Pass explicit agentIds, a collectionId (its current members are added), or both. Duplicates are removed.
# One device, restart in 5 minutes
POST /api/agents/550e8400-e29b-41d4-a716-446655440000/restart
{ "delaySeconds": 300 }

# A collection's members plus one extra device, restart in 1 minute
POST /api/agents/restart
{
  "agentIds": ["550e8400-e29b-41d4-a716-446655440000"],
  "collectionId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "delaySeconds": 60
}

Both endpoints return the per-device result: agentId, hostname, status (one of the outcomes above), commandId when the restart was sent, and reason when it was not.

Status codeSingle deviceBulk
200The restart was sent.Always, once the request is valid. Offline and non-Windows devices are reported in the results, not treated as errors.
400delaySeconds outside 0–3600. Nothing is restarted.delaySeconds outside 0–3600, or the request resolves to no agents.
404No such agent.The collectionId does not exist.
409The agent is offline, not Windows, or the command could not be sent. The message names the outcome.—
403The caller does not hold agents.restart.

From PowerShell, call these endpoints with Invoke-RestMethod. The Athena module does not have a dedicated restart cmdlet. See the API Reference for authentication.

Auditing#

Each request writes one AgentRestartRequested event at Warning severity to the audit log. This happens whether the request came from the console or the API, and even when no device was sent the restart. The description records the delay, who asked, how many agents were targeted, the command ID when one was sent, and the hostnames grouped by outcome (dispatched, offline, not supported, failed, not found). For a single-device request, the event's resource is that agent, so it shows up in the agent's own audit trail. See Audit Event Types.

Troubleshooting#

SymptomCause & fix
No restart button anywhereYour account lacks agents.restart. Ask an Admin for the Operator role or higher.
The Agents list has no Restart (N) buttonIt only appears after you tick at least one agent in the checkbox column.
Restart is Windows-only for nowThe target is a Linux agent. Restart it another way, for example with a remote command.
Shown as Dispatched but the device never restartedCheck the device's result in the command history. Skipped / Agent in Maintenance Mode means the device is in maintenance mode. Also check the device's command output, and whether someone ran shutdown /a during the delay.
Inventory didn't refresh after the restartThe automatic follow-up runs when the device reconnects. If the server itself restarted in between, that pending follow-up is lost. Ask the device for a fresh inventory collection by hand.