Set-SecretStoreConfiguration

Sets SecretStore configuration properties.

Syntax

Set-SecretStoreConfiguration
   [-Scope <SecureStoreScope>]
   [-Authentication <Authenticate>]
   [-PasswordTimeout <Int32>]
   [-Interaction <Interaction>]
   [-Password <SecureString>]
   [-PassThru]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SecretStoreConfiguration
   [-Default]
   [-Password <SecureString>]
   [-PassThru]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

This cmdlet takes individual parameter arguments that determine SecretStore configuration. Or the Default parameter can be used to restore SecretStore configuration to default settings.

Examples

Example 1

PS C:\> Set-SecretStoreConfiguration -Default

Confirm
Are you sure you want to perform this action?
Performing the operation "Changes local store configuration" on target "SecretStore module local store".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y

      Scope Authentication PasswordTimeout Interaction
      ----- -------------- --------------- -----------
CurrentUser       Password             900      Prompt

This example uses the command to restore the SecretStore configuration settings to their default values.

Parameters

-Authentication

Configuration option to set authentication for store access. Configuration options are 'Password' or 'None'. When 'Password' is selected, SecretStore is configured to require a password for accessing secrets. Default authentication is 'Password', as this provides the strongest protection of secret data.

Type:Authenticate
Position:Named
Default value:Password
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-Default

This parameter switch sets SecretStore configuration to its default settings.

Type:SwitchParameter
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-Interaction

Configuration option to allow or suppress user prompting. Configuration options are 'Prompt' or 'None'. When 'None' is selected, no prompt will be presented in an interactive session to provide a session password. Default value is 'Prompt', and users will be prompted for password when needed. When 'None' is selected and a session password is required, a Microsoft.PowerShell.SecretStore.PasswordRequiredException error is thrown.

Type:Interaction
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-PassThru

When used, will write the current SecretStore configuration to the pipeline.

Type:SwitchParameter
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-Password

Password to be applied when changing the authentication configuration. When changing the configuration from no password required to password required, the provided password will be set as the new store password. When changing the configuration from password required to no password required, the provided password will be used to authorize the configuration change, and must be the current password used to unlock the store. This command cannot be used to change the store password. To change an existing password, use the Set-SecretStorePassword command.

Type:SecureString
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PasswordTimeout

Configuration option that provides the session password timeout in seconds. Takes an argument whose value determines the session password timeout in seconds. When the timeout value is reached, the current password value is invalidated for the session.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Scope

Configuration option that determines SecretStore operation scope. Currently only 'CurrentUser' scope is supported.

Type:SecureStoreScope
Accepted values:CurrentUser, AllUsers
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

Microsoft.PowerShell.SecretStore.SecureStoreConfig