For the complete documentation index, see llms.txt. This page is also available as Markdown.

Grant-PSUAppToken

Grants a new app token.

SYNOPSIS

Grants a new app token.

SYNTAX

CurrentUser (Default)

Grant-PSUAppToken [-Expiry <DateTime>] [-Description <String>] [-ComputerName <String>] [-AppToken <String>]
 [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]

Grant

Grant-PSUAppToken -Identity <Identity> [-Expiry <DateTime>] [-Role <String[]>] [-Description <String>]
 [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>] [-UseDefaultCredentials]
 [-Integrated] [-TrustCertificate] [-Cookies] [<CommonParameters>]

GrantCustom

Grant-PSUAppToken -IdentityName <String> [-Expiry <DateTime>] [-Role <String[]>] [-Description <String>]
 [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>] [-UseDefaultCredentials]
 [-Integrated] [-TrustCertificate] [-Cookies] [<CommonParameters>]

DESCRIPTION

Grants a new app token. App tokens can be used to call the PowerShell Universal Management API and other custom REST APIs.

EXAMPLES

Example 1

Grants a new app token to the MyIdentity user that expires in 30 days and provides Reader access.

Example 2

Generates a new app token using the specified signing key for the MyIdentity user.

PARAMETERS

-AppToken

The AppToken that is used for calling the PowerShell Universal Management API. You can also call Connect-PSUServer before calling this cmdlet to set the AppToken for the entire session.

-ComputerName

Specifies the computer name or URL that should be called when accessing the PowerShell Universal Management API. You can also use Connect-PSUServer before calling this cmdlet to set the computer name for the entire session.

-Expiry

The expiration date of the app token.

-Identity

The Identity object to create the app token for. Use Get-PSUIdentity to retrieve the identities.

-IdentityName

The name of the identity to generate or grant for the app token.

-Role

The role to grant to the identity of the app token.

-UseDefaultCredentials

Use default credentials when connecting to the management API

-Integrated

Executes the command internally rather than using the Management API. Only works when running script from within PowerShell Universal.

-Credential

Credentials to login to the PowerShell Universal Management API.

-TrustCertificate

Whether the cmdlet should ignore certificate issues.

-Description

Provides the description of the app token.

-Cookies

Reuses and persists authentication cookies for the current PowerShell session.

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -Verbose, -WarningAction, -WarningVariable, and -ProgressAction. For more information, see about_CommonParameters.

INPUTS

None

OUTPUTS

System.Object

NOTES

Get-PSUIdentity

Last updated

Was this helpful?