document type: cmdlet external help file: powershellYK.dll-Help.xml HelpUri: Module Name: powershellYK ms.date: 03-19-2026 PlatyPS schema version: 2024-05-01
Allows the updating of PIV settings
Set-YubiKeyPIV -PinRetries <byte> -PukRetries <byte> [-KeepPukUnlocked] [-WhatIf] [-Confirm]
[<CommonParameters>]
Set-YubiKeyPIV -PIN <securestring> -NewPIN <securestring> [-ChangePIN] [-WhatIf] [-Confirm]
[<CommonParameters>]
Set-YubiKeyPIV -NewPIN <securestring> -PUK <securestring> [-UnblockPIN] [-WhatIf] [-Confirm]
[<CommonParameters>]
Set-YubiKeyPIV -PUK <securestring> -NewPUK <securestring> [-ChangePUK] [-WhatIf] [-Confirm]
[<CommonParameters>]
Set-YubiKeyPIV -ManagementKey <psobject> -NewManagementKey <psobject> -Algorithm <PivAlgorithm>
-TouchPolicy <PivTouchPolicy> [-WhatIf] [-Confirm] [<CommonParameters>]
Set-YubiKeyPIV -newCHUID [-WhatIf] [-Confirm] [<CommonParameters>]
Set-YubiKeyPIV -PINProtectedManagementkey [-WhatIf] [-Confirm] [<CommonParameters>]
Allows the modification of PIV settings like: PIN, PUK, ManagementKey and CHUID.
PS C:\> Set-YubikeyPIV -PinRetries 8 -PukRetries 4
WARNING: PIN and PUK codes reset to default, remember to change.Updates the PIV to 8 PIN retries and 4 PUK retries.
PS C:\GIT-VS\Yubikey_Powershell> Set-YubikeyPIV -ChangePIN
cmdlet Set-YubikeyPIV at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
PIN: ******
NewPIN: ******Change PIN with a easy way of requesting the new codes.
Algoritm
Type: Yubico.YubiKey.Piv.PivAlgorithm
DefaultValue: None
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ChangeManagement
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues:
- TripleDES
- AES128
- AES192
- AES256
HelpMessage: ''Change the PIN
Type: System.Management.Automation.SwitchParameter
DefaultValue: None
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ChangePIN
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''Change the PUK (PIN Unblocking Key)
Type: System.Management.Automation.SwitchParameter
DefaultValue: None
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ChangePUK
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''Prompts you for confirmation before running the cmdlet.
Type: System.Management.Automation.SwitchParameter
DefaultValue: None
SupportsWildcards: false
Aliases:
- cf
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''Keep PUK unlocked
Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ChangeRetries
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''Current Management key
Type: System.Management.Automation.PSObject
DefaultValue: None
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ChangeManagement
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''Generate new CHUID
Type: System.Management.Automation.SwitchParameter
DefaultValue: None
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: newCHUID
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''New Management key
Type: System.Management.Automation.PSObject
DefaultValue: None
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ChangeManagement
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''New PIN
Type: System.Security.SecureString
DefaultValue: None
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ChangePIN
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
- Name: UnblockPIN
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''New PUK
Type: System.Security.SecureString
DefaultValue: None
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ChangePUK
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''Current PIN
Type: System.Security.SecureString
DefaultValue: None
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ChangePIN
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''PIN protect the Management key
Type: System.Management.Automation.SwitchParameter
DefaultValue: None
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Set Managementkey to PIN protected
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''Change the number of PIN retries
Type: System.Nullable`1[System.Byte]
DefaultValue: None
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ChangeRetries
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''Current PUK
Type: System.Security.SecureString
DefaultValue: None
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: UnblockPIN
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
- Name: ChangePUK
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''Change the number of PUK retries
Type: System.Nullable`1[System.Byte]
DefaultValue: None
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ChangeRetries
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''Touch policy
Type: Yubico.YubiKey.Piv.PivTouchPolicy
DefaultValue: None
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ChangeManagement
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues:
- Default
- Never
- Always
- Cached
HelpMessage: ''Unblock the PIN
Type: System.Management.Automation.SwitchParameter
DefaultValue: None
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: UnblockPIN
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''Runs the command in a mode that only reports what would happen without performing the actions.
Type: System.Management.Automation.SwitchParameter
DefaultValue: None
SupportsWildcards: false
Aliases:
- wi
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
{{ Fill in the related links here }}