> 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/da/config/management-api.md).

# Management API

Brug administrations-API'en i PowerShell Universal til at automatisere handlinger i admin console via REST-kald, Universal-modulet og godkendelse med app-token.

De kan administrere PowerShell Universal ved hjælp af den indbyggede administrations-API. Den giver mulighed for at udføre alle handlinger som administrationskonsollen på en automatiseret måde. De kan se og teste API'en ved at besøge Swagger API-dokumentationen på dens standardplacering på Deres maskine `http://localhost:5000/swagger/index.html` .

{% hint style="info" %}
Administrations-API'en er indbygget og kræver ikke en licens til Universal API.
{% endhint %}

## PowerShell-modul

Vi leverer et PowerShell-modul, der kalder API'en på Deres vegne, så De ikke selv behøver at skrive HTTP-anmodningerne. De kan downloade dette modul fra PowerShell Gallery.

```powershell
Install-Module Universal
```

PowerShell-modulet kræver et app-token og et computernavn for at kalde Universal-serveren. De kan angive disse elementer ved hvert kald.

```powershell
Invoke-PSUScript -Script $Script -ComputerName http://localhost:5000 -AppToken $AppToken
```

Derudover kan De oprette forbindelse til Universal-serveren ved hjælp af `Connect-UAServer`.

```powershell
Connect-PSUServer -ComputerName http://localhost:5000 -AppToken $AppToken
```

## REST API

PowerShell Universal-administrations-API'en kan tilgås via REST-kald. De kan se de tilgængelige kald ved hjælp af den indbyggede Swagger API-dokumentation. De skal bruge et App Token til at foretage kald til REST-API'en.

## App Tokens

[App Tokens](/powershell-universal/da/sikkerhed/app-tokens.md) er påkrævede af administrations-API'en. De skal bruge et App Token både med PowerShell-cmdletterne og ved direkte kald af administrations-API'en via REST.

De kan bruge et app-token med `Invoke-RestMethod` ved at angive Authorization-headeren.

```powershell
Invoke-RestMethod http://localhost:5000/api/v1/script -Headers @{ Authorization = "Bearer appToken" }
```


---

# 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/da/config/management-api.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.
