> 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/de/powershell-befehle/set-psuauthenticationmethod.md).

# Set-PSUAuthenticationMethod

## SYNOPSIS

Legt die Einstellungen der Authentifizierungsmethode fest.

## SYNTAX

### Type (Default)

```
Set-PSUAuthenticationMethod [-ScriptBlock <ScriptBlock>] [-Type <AuthenticationMethodType>] [-Disabled]
 [-Configure <ScriptBlock>] [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>]
 [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]
```

### SAML2

```
Set-PSUAuthenticationMethod [-ScriptBlock <ScriptBlock>] [-Type <AuthenticationMethodType>] [-Disabled]
 -CallbackPath <String> [-MetadataAddress <String>] [-SigningKey <String>] [-EntityId <String>]
 [-IdentityProviderEntityId <String>] [-ServiceCertificate <String>] [-SingleSignOnServiceUrl <String>]
 [-Configure <ScriptBlock>] [-AllowUnsolicitedAuthnResponse] [-NameIdPolicy <String>] [-LoadMetadata]
 [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>] [-UseDefaultCredentials]
 [-Integrated] [-TrustCertificate] [-Cookies] [<CommonParameters>]
```

### OIDC

```
Set-PSUAuthenticationMethod [-ScriptBlock <ScriptBlock>] [-Type <AuthenticationMethodType>] [-Disabled]
 -CallbackPath <String> -ClientId <String> [-ClientSecret <String>] [-Resource <String>] [-Authority <String>]
 [-ResponseType <String>] [-SaveTokens <Boolean>] [-UseTokenLifetime <Boolean>] [-RequireMfa]
 [-GetClaimsFromUserInfoEndpoint <Boolean>] [-Scopes <String>] [-CorrelationCookieSameSite <String>]
 [-Configure <ScriptBlock>] [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>]
 [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]
```

### WSFed

```
Set-PSUAuthenticationMethod [-ScriptBlock <ScriptBlock>] [-Type <AuthenticationMethodType>] [-Disabled]
 -CallbackPath <String> [-UseTokenLifetime <Boolean>] [-CorrelationCookieSameSite <String>] -Wtrealm <String>
 -Wreply <String> -MetadataAddress <String> [-Configure <ScriptBlock>] [-ComputerName <String>]
 [-AppToken <String>] [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate]
 [-Cookies] [<CommonParameters>]
```

### LogoutUrl

```
Set-PSUAuthenticationMethod [-ScriptBlock <ScriptBlock>] [-Type <AuthenticationMethodType>] [-Disabled]
 [-LogoutUrl <String>] [-Configure <ScriptBlock>] [-ComputerName <String>] [-AppToken <String>]
 [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]
```

### Form

```
Set-PSUAuthenticationMethod [-ScriptBlock <ScriptBlock>] [-Type <AuthenticationMethodType>] [-Disabled]
 [-Configure <ScriptBlock>] [-Native] [-ComputerName <String>] [-AppToken <String>]
 [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]
```

### Domain

```
Set-PSUAuthenticationMethod [-ScriptBlock <ScriptBlock>] [-Type <AuthenticationMethodType>] [-Disabled]
 [-Configure <ScriptBlock>] [-Domain <String>] [-ComputerName <String>] [-AppToken <String>]
 [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]
```

## DESCRIPTION

Legt die Einstellungen der Authentifizierungsmethode fest.

Die Authentifizierungseinstellungen werden in .universal/authentication.ps1 gespeichert

Sie können dieses Cmdlet auch mit der PowerShell Universal Management-API verwenden.

## EXAMPLES

### Beispiel 1

```
PS C:\> Set-PSUAuthenticationMethod -ScriptBlock {
    param($Credential) 

    if ($Credential.UserName -eq 'Adam')
    {
        New-PSUAuthenticationResult -Success -UserName 'Adam'
    }
    else 
    {
        New-PSUAuthenticationResult -ErrorMessage 'Not Adam!'
    }

}
```

Skriptblöcke der Formularauthentifizierung erhalten einen einzelnen $Credential-Parameter, der ein PSCredential-Objekt enthält. Sie müssen ein New-PSUAuthenticationResult aus dem Skriptblock zurückgeben, um Zugriff zu gewähren oder zu verweigern.

## PARAMETERS

### -AppToken

Das AppToken, das für den Aufruf der PowerShell Universal Management-API verwendet wird. Sie können auch Connect-PSUServer aufrufen, bevor Sie dieses Cmdlet aufrufen, um das AppToken für die gesamte Sitzung festzulegen.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ComputerName

Gibt den Computernamen oder die URL an, die beim Zugriff auf die PowerShell Universal Management-API aufgerufen werden soll. Sie können auch Connect-PSUServer verwenden, bevor Sie dieses Cmdlet aufrufen, um den Computernamen für die gesamte Sitzung festzulegen.

```yaml
Type: String
Parameter Sets: (All)
Aliases: Uri

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ScriptBlock

Der Skriptblock, der ausgeführt wird, wenn sich ein Benutzer anmeldet.

```yaml
Type: ScriptBlock
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Disabled

Ob die Formularauthentifizierung deaktiviert ist.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -UseDefaultCredentials

Standard-Anmeldeinformationen bei der Verbindung mit der Management-API verwenden

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Authority

Die OpenID Connect-Authority-URL.

```yaml
Type: String
Parameter Sets: OIDC
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -CallbackPath

Der Callback-Pfad, den die Authority nach der Authentifizierung aufruft.

```yaml
Type: String
Parameter Sets: SAML2, OIDC, WSFed
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ClientId

Die OpenID Connect-Client-ID, die der Authority übergeben wird.

```yaml
Type: String
Parameter Sets: OIDC
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ClientSecret

Das OpenID Connect-Client-Secret, das der Authority übergeben wird.

```yaml
Type: String
Parameter Sets: OIDC
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Configure

Zusätzliches Konfigurationsskript, das ausgeführt werden kann, um die Einstellungen des Authentifizierungsanbieters zu aktualisieren. Weitere Informationen finden Sie in unserer Online-Dokumentation.

```yaml
Type: ScriptBlock
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -CorrelationCookieSameSite

Die CorrelationCookieSameSite-Einstellung, die für die OpenID Connect- oder WS-Federation-Authentifizierung verwendet wird.

```yaml
Type: String
Parameter Sets: OIDC, WSFed
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -EntityId

Die Entitäts-ID für die SAML2-Authentifizierung.

```yaml
Type: String
Parameter Sets: SAML2
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -GetClaimsFromUserInfoEndpoint

Ob zusätzliche Claim-Informationen von der OpenID Connect-Authority zurückgegeben werden sollen. Diese Einstellung wird nicht von allen Authorities unterstützt.

```yaml
Type: Boolean
Parameter Sets: OIDC
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -IdentityProviderEntityId

Die Identity Provider Entity ID für die SAML2-Authentifizierung. Dies ist normalerweise die URL, die für die Authentifizierung aufgerufen wird.

```yaml
Type: String
Parameter Sets: SAML2
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Integrated

Führt den Befehl intern aus, anstatt die Management-API zu verwenden. Funktioniert nur, wenn das Skript innerhalb von PowerShell Universal ausgeführt wird.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -MetadataAddress

Die SAML2- oder WS-Federation-Metadatenadresse. Für SAML2 sollte diese angegeben werden, wenn sie sich von der Identity Provider Entity ID unterscheidet. Für WS-Federation ist diese Einstellung erforderlich.

```yaml
Type: String
Parameter Sets: SAML2
Aliases: MetadataUrl

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

```yaml
Type: String
Parameter Sets: WSFed
Aliases: MetadataUrl

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Resource

Eine Ressource, für die bei der Authentifizierung mit OpenID Connect ein Token gewährt wird.

```yaml
Type: String
Parameter Sets: OIDC
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ResponseType

Der OpenID Connect-Antworttyp. Dieser kann token oder code sein.

```yaml
Type: String
Parameter Sets: OIDC
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -SaveTokens

Ob die Tokens im OpenID Connect-Cookie gespeichert werden sollen.

```yaml
Type: Boolean
Parameter Sets: OIDC
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Scopes

Scopes, die während der OpenID Connect-Authentifizierung angefordert werden.

```yaml
Type: String
Parameter Sets: OIDC
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ServiceCertificate

Das Dienstzertifikat, das bei der Authentifizierung gegenüber dem SAML2-Identity-Provider verwendet wird.

```yaml
Type: String
Parameter Sets: SAML2
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Type

Der Typ der Authentifizierungsmethode.

```yaml
Type: AuthenticationMethodType
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -UseTokenLifetime

Ob die Token-Lebensdauer als Cookie-Lebensdauer verwendet werden soll.

```yaml
Type: Boolean
Parameter Sets: OIDC, WSFed
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Wreply

Die WS-Federation-Wreply-Einstellung.

```yaml
Type: String
Parameter Sets: WSFed
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Wtrealm

Die WS-Federation-Wrealm-Einstellung.

```yaml
Type: String
Parameter Sets: WSFed
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -RequireMfa

Die MFA-Anforderung für OpenID Connect erzwingen.

```yaml
Type: SwitchParameter
Parameter Sets: OIDC
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -SigningKey

Ein Zertifikatssignierschlüssel, der mit SAML2 verwendet wird.

```yaml
Type: String
Parameter Sets: SAML2
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -SingleSignOnServiceUrl

Die Single-Sign-On-Dienst-URL für SAML2.

```yaml
Type: String
Parameter Sets: SAML2
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -LogoutUrl

Die Logout-URL für OpenAPI Connect oder WS-Federation.

```yaml
Type: String
Parameter Sets: LogoutUrl
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -AllowUnsolicitedAuthnResponse

Unaufgeforderte Authentifizierungsantworten für SAML2 zulassen.

```yaml
Type: SwitchParameter
Parameter Sets: SAML2
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Credential

Anmeldeinformationen für die Anmeldung an der PowerShell Universal Management-API.

```yaml
Type: PSCredential
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -TrustCertificate

Ob das Cmdlet Zertifikatsprobleme ignorieren soll.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -LoadMetadata

Ob Metadaten für die SAML2-Authentifizierung geladen werden sollen.

```yaml
Type: SwitchParameter
Parameter Sets: SAML2
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -NameIdPolicy

Die SAML2-Name-ID-Richtlinie.

```yaml
Type: String
Parameter Sets: SAML2
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Domain

Die Domäne, an der sich bei nativer Authentifizierung angemeldet wird.

```yaml
Type: String
Parameter Sets: Domain
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Native

Die Formularauthentifizierung verwendet das native Betriebssystem für die Anmeldung. Derzeit nur unter Windows unterstützt.

```yaml
Type: SwitchParameter
Parameter Sets: Form
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Cookies

Verwendet Authentifizierungscookies für die aktuelle PowerShell-Sitzung wieder und speichert sie dauerhaft.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters

Dieses Cmdlet unterstützt die allgemeinen Parameter: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -Verbose, -WarningAction, -WarningVariable und -ProgressAction. Weitere Informationen finden Sie unter [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

### Keine

## OUTPUTS

### System.Object

## NOTES

## RELATED LINKS

[New-PSUAuthenticationResult](/powershell-universal/de/powershell-befehle/new-psuauthenticationresult.md)


---

# 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://docs.devolutions.net/powershell-universal/de/powershell-befehle/set-psuauthenticationmethod.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.
