-
Notifications
You must be signed in to change notification settings - Fork 46
New StoredCredential
Create a new credential in the Windows Credential Store/Vault
New-StoredCredential [-Target <String>] [-UserName <String>] [-Password <String>] [-Comment <String>] [-Type <Cred_Type>] [-Persist <Cred_Persist>] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [<CommonParameters>]New-StoredCredential [-Target <String>] [-UserName <String>] [-SecurePassword <SecureString>] [-Comment <String>] [-Type <Cred_Type>] [-Persist <Cred_Persist>] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [<CommonParameters>]
New-StoredCredential [-Target <String>] [-Comment <String>] [-Type <Cred_Type>] [-Persist <Cred_Persist>] [-Credentials <PSCredential>] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [<CommonParameters>]
Create a new credential in the Windows Credential Store/Vault
Specifies the target of the credentials being added.
Required? | False |
Position? | named |
Default value | hostname of localhost |
Accept pipeline input? | false |
Accept wildcard characters? | False |
specified the username to be used for the credentials, cannot be used in conjunction with Credentials parameter.
Required? | False |
Position? | named |
Default value | logged on user |
Accept pipeline input? | false |
Accept wildcard characters? | False |
Specifies the password in plain text, cannot be used in conjunction with SecurePassword or Credential parameters.
Required? | False |
Position? | named |
Default value | |
Accept pipeline input? | false |
Accept wildcard characters? | False |
Provides a comment to identify the credentials in the store
Required? | False |
Position? | named |
Default value | |
Accept pipeline input? | false |
Accept wildcard characters? | False |
Type of credential to store, possible values are [GENERIC, DOMAIN_PASSWORD, DOMAIN_CERTIFICATE, DOMAIN_VISIBLE_PASSWORD, GENERIC_CERTIFICATE, DOMAIN_EXTENDED, MAXIMUM, MAXIMUM_EX]
Required? | False |
Position? | named |
Default value | GENERIC |
Accept pipeline input? | false |
Accept wildcard characters? | False |
sets the persistence settings of the credential, possible values are [SESSION, LOCALMACHINE, ENTERPRISE]
Required? | False |
Position? | named |
Default value | SESSION |
Accept pipeline input? | false |
Accept wildcard characters? | False |
Required? | False |
Position? | named |
Default value | |
Accept pipeline input? | false |
Accept wildcard characters? | False |
Required? | False |
Position? | named |
Default value | |
Accept pipeline input? | false |
Accept wildcard characters? | False |
provides the password as a secure string, cannot be used in conjunction with Password or Credential parameters
Required? | False |
Position? | named |
Default value | |
Accept pipeline input? | false |
Accept wildcard characters? | False |
provides the username and password as a PSCredential object, cannot be used in conjunction with Password, SecurePassword or UserName parameters
Required? | False |
Position? | named |
Default value | |
Accept pipeline input? | true (ByValue) |
Accept wildcard characters? | False |
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
PS C:\> New-StoredCredential -Target server01 -UserName test-user -Password Password1
Flags : 0 Type : GENERIC TargetName : server01 Comment : Updated by: Dave on: 23/04/2016 LastWritten : 23/04/2016 10:48:56 PaswordSize : 18 Password : Password1 Persist : SESSION AttributeCount : 0 Attributes : 0 TargetAlias : UserName : test-user
creates a credential for server01 with the username test-user and password Password1
PS C:\> Get-Credential -UserName test-user -Message "password please" | New-StoredCredential -Target Server01
Creates a credential for Server01 with the username and password provided in the PSCredential object from Get-Credential