Skip to content
This repository has been archived by the owner on Sep 1, 2021. It is now read-only.

Get StoredCredential

Dave edited this page Apr 23, 2016 · 1 revision

Get-StoredCredential

Synopsis

Gets stored credentials from the Windows Credential Store/Vault

Syntax

Get-StoredCredential [-Target <String>] [-Type <Cred_Type>] [-AsCredentialObject] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [<CommonParameters>]

Description

Gets stored credentials from the Windows Credential Store/Vault and returns as either a PSCredential object or as a Credential Object

Parameters

-Target <String>

The command will only return credentials with the specified target

Required? False
Position? named
Default value  
Accept pipeline input? true (ByValue)
Accept wildcard characters? False

-Type <Cred_Type>

Specifies the type of credential to return, 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

-AsCredentialObject <SwitchParameter>

Switch to return the credentials as Credential objects instead of the default PSObject

Required? False
Position? named
Default value false
Accept pipeline input? false
Accept wildcard characters? False

-InformationAction <ActionPreference>

Required? False
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-InformationVariable <String>

Required? False
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

<CommonParameters>

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).

Inputs

Outputs

Notes

Credential object, contains more data and returns the password as plain text

Examples

Example 1

PS C:\> Get-StoredCredential -Target Server01
UserName                      Password
--------                      --------
test-user System.Security.SecureString

Returns credentials for Server01 as a PSCredential object

Example 2

PS C:\> Get-StoredCredential -Target Server01 -AsCredentialObject
Flags          : 0
Type           : GENERIC
TargetName     : server01
Comment        : 
LastWritten    : 23/04/2016 10:01:37
PaswordSize    : 18
Password       : Password1
Persist        : ENTERPRISE
AttributeCount : 0
Attributes     : 0
TargetAlias    : 
UserName       : test-user

Returns credentials for Server01 as a Credential object

Related links