> 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/powershell-kommandoer/get-psuusersession.md).

# Get-PSUUserSession

Forespørg forbundne PowerShell Universal-brugersessioner efter ID, kilde, bruger eller computer.

## Synopsis

Henter PowerShell Universal-brugersessioner.

## Syntaks

```powershell
Get-PSUUserSession -Id <Int64> [<ConnectionOptions>] [<CommonParameters>]
Get-PSUUserSession [-Source <String>] [-UserName <String>] [-ComputerName <String>] [<ConnectionOptions>] [<CommonParameters>]
```

`<ConnectionOptions>`: `[-AppToken <String>] [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]`. For denne kommando filtrerer `-ComputerName` i listeparametersættet sessioner efter den computer, der ejer dem; det er ikke et mål for administrations-API'en. Opret først forbindelse til den ønskede PSU-server med `Connect-PSUServer`.

## Beskrivelse

Henter registreringer af brugersessioner. Brug kommandoens navn i ental; den erstatter den tidligere eksporterede kommando `Get-PSUUserSessions`. Listefiltrene understøtter jokertegn. Brug `-Id` til at hente en enkelt session i stedet for at kombinere den med listefiltre.

## Eksempler

```powershell
Get-PSUUserSession
Get-PSUUserSession -Id 10
Get-PSUUserSession -UserName 'admin'
Get-PSUUserSession -Source 'Dashboard'
Get-PSUUserSession -ComputerName 'server01'
```

## Parametre

| Parameter                | Beskrivelse                                                                                                    |
| ------------------------ | -------------------------------------------------------------------------------------------------------------- |
| `-Id`                    | Påkrævet numerisk id for én session (parametersættet Id).                                                      |
| `-Source`                | Kildefilter; understøtter jokertegn (parametersættet All).                                                     |
| `-UserName`              | Brugernavnsfilter; understøtter jokertegn (parametersættet All).                                               |
| `-ComputerName`          | Computer, der ejer sessionen; understøtter jokertegn (parametersættet All), ikke en mål-URL til en PSU-server. |
| `-AppToken`              | App-token til Management API.                                                                                  |
| `-Credential`            | Legitimationsoplysninger til Management API.                                                                   |
| `-UseDefaultCredentials` | Bruger de aktuelle Windows-legitimationsoplysninger.                                                           |
| `-Integrated`            | Bruger den integrerede administrationsklient i processen.                                                      |
| `-TrustCertificate`      | Ignorerer fejl ved certifikatvalidering.                                                                       |
| `-Cookies`               | Genbruger sessionscookies til godkendelse.                                                                     |

## Output

`PowerShellUniversal.UserSession`.

## Tilladelser

Adgangstokenet kræver `platform.usersessions/read` for at køre denne cmdlet eksternt.


---

# 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/powershell-kommandoer/get-psuusersession.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.
