Skip to content

Set-PveAccessUsersToken

Update API token for a specific user. NOTE: when ‘regenerate’ is set, the returned token value needs to be stored as it cannot be retrieved afterwards!

API: PUT /access/users/{userid}/token/{tokenid}, Proxmox VE API viewer

Set-PveAccessUsersToken
[-PveTicket <PveTicket>]
[-Comment <string>]
[-Delete <string>]
[-Expire <int>]
[-Privsep <bool>]
[-Regenerate <bool>]
-Tokenid <string>
-Userid <string>
[<CommonParameters>]
Parameter Type Required Description
-PveTicket PveTicket No Ticket data connection.
-Comment string No
-Delete string No A list of settings you want to delete.
-Expire int No API token expiration date (seconds since epoch). ‘0’ means no expiration date.
-Privsep bool No Restrict API token privileges with separate ACLs (default), or give full privileges of corresponding user.
-Regenerate bool No Regenerate the token’s secret value. All users of the previous secret will lose access after this operation.
-Tokenid string Yes User-specific token identifier.
-Userid string Yes Full User ID, in the name@realm format.

Every parameter also binds by property name from the pipeline, so an object with node and vmid properties (the output of Get-PveGuest, for one) fills -Node and -Vmid. Without -PveTicket the cmdlet uses the last connection, see Connection.

A PveResponse: the data returned by Proxmox VE is in .Response.data, the outcome in .IsSuccessStatusCode. See Results and Errors.