> For the complete documentation index, see [llms.txt](https://eaclouddoc.eauditor.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://eaclouddoc.eauditor.eu/eacloud-docs-en/features/it-management/tasks.md).

# Tasks

The Task Server enables remote execution of PowerShell and CMD scripts on computers with eAgent. Scripts can be run once, scheduled for a specific date and time, or executed periodically.

The module allows you to create a script library, organize it into groups, generate code with the help of eA Intelligence, and analyze the results of executed tasks in logs.

<figure><img src="https://3262380731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdzip3GyvGq5q5J3qckWN%2Fuploads%2FMHNN8pzFPaaPKoHJUffN%2Fimage.png?alt=media&amp;token=4c61f3e0-e4c6-4143-b057-e6bce98ab8e6" alt="Widok biblioteki skryptów oraz dostępnych operacji w Serwerze zadań." width="375"><figcaption><p><em>View of the script library and available operations in the Task Server.</em></p></figcaption></figure>

### Script library

The script library view allows you to browse available scripts, filter them, and open their details.

Scripts are divided into:

* **Public** - scripts shared in the system.
* **Private** - scripts created by administrators of a given instance using the **Create script**.

You can edit, delete, and assign private scripts to your own groups. The view also supports filtering and searching, making it easier to find the needed script in a larger library.

### What you will find in this section

* **Scripts and script groups** - creating, editing, and organizing scripts.
* **Task execution and schedules** - executing scripts on computers and device groups.
* **Logs** - reviewing results and analyzing the full log with AI.

### Use cases

The Task Server lets you automate repetitive administrative tasks without logging in to each computer separately.

Example use cases:

* checking available disk space on computers,
* verifying the status of a selected Windows service,
* displaying a message to the user and then executing the next command,
* remotely shutting down or restarting computers,
* deleting temporary files,
* collecting diagnostic information from multiple devices.

#### Example - checking free disk space

The following PowerShell script displays the amount of free space on local drives:

```powershell
Get-CimInstance Win32_LogicalDisk -Filter "DriveType = 3" |
ForEach-Object {
    $freeSpace = [math]::Round($_.FreeSpace / 1GB, 2)
    $totalSpace = [math]::Round($_.Size / 1GB, 2)

    Write-Host "$($_.DeviceID) - free space: $freeSpace GB of $totalSpace GB"
}
```

#### Example - message for the user and shutting down the computer

The script can execute several commands in sequence. In this example, the user receives a message, and the computer is shut down after five minutes:

```powershell
$msg = New-Object -ComObject Wscript.Shell
$msg.Popup(
    "The computer will be shut down in 5 minutes. Save your work.",
    30,
    "Administrator message",
    48
)

Start-Sleep -Seconds 300
Shutdown.exe /s /t 0
```

{% hint style="warning" %}
Scripts that affect user work, such as closing programs, restarting, or shutting down a computer, should always be tested first on a test device.
{% endhint %}

### FAQ

<details>

<summary>Which scripting languages does the Task Server support?</summary>

The module supports PowerShell and CMD scripts.

</details>

<details>

<summary>Can I run a script on multiple computers?</summary>

Yes. When creating a task, you can specify multiple computers or device groups.

I'll add a screenshot here

</details>

<details>

<summary>Does a script group run all scripts assigned to it?</summary>

No. Groups are used only to organize the library. Within a task, you run one selected script. - but you can enter more scripts in the command line and they will execute as if they were run on the workstation, e.g., display a message and after the message shut down the PC

</details>


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://eaclouddoc.eauditor.eu/eacloud-docs-en/features/it-management/tasks.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
