Skip to content

4 Plex Authentication Token

m1lkman edited this page Mar 17, 2023 · 1 revision

Get-PlexToken cmdlet for generating a plex Authentication Token

Generate a Plex Authentication token so you don't have to save your credentials in your scripts or scheduled tasks. This cmdlet will prompt for credentials when running interactively. Once created, you will be able to find your token here https://app.plex.tv/desktop/#!/settings/devices/other if you wish to remove it at any time.

Syntax

Get-PlexToken [[-PlexLogin] <string>] [[-PlexPassword] <string>] [-Plex2FA] [-Product <string>] [-Version <string>] [-PassThru]  [<CommonParameters>]

Get-PlexToken [[-Credential] <pscredential>] [-Plex2FA] [-Product <string>] [-Version <string>] [-PassThru] [<CommonParameters>]

Examples

Generate Plex Token with Plex.tv Email or ID and password

Get-PlexToken -PlexLogin <Email/ID> -PlexPassword <Password>

Generate Plex Token with Plex.tv Email or ID, password, and prompt for Plex Two-Factor auth code (if 2FA is enabled for your Plex.tv account)

Get-PlexToken -PlexLogin <Email/ID> -PlexPassword <Password> -Plex2FA

Parameters

All parameters can be specified either at the command-line or set in the Parameters section of the script file itself if you prefer. Edit at your own risk. See examples below for use cases. Use Get-Help cmdlet for details about parameters and usage.

-Credential

PSCredential Object

Type: PSCrendtial
Parameter Sets: PSCredential

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

-PassThru

Enable passthru

Type: Switch
Parameter Sets: (All)

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

-Plex2FA

Enable support for Plex Two-Factor auth code prompt

Type: Switch
Parameter Sets: (All)

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

-PlexLogin

Plex.tv email or ID

Type: String
Parameter Sets: Credential

Required: False
Position: 0
Default value: None
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: False

-PlexPassword

Plex.tv Password

Type: String
Parameter Sets: Credential

Required: False
Position: 1
Default value: None
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: False

-Product

Plex Token Product Name

Type: String
Parameter Sets: (All)

Required: False
Position: None
Default value: Get-PlexTokan
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: False

-Version

Plex Token Product Version

Type: String
Parameter Sets: (All)

Required: False
Position: None
Default value: v2.0.0
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: False

Clone this wiki locally