< Back

Get-StoredCredential

Mon Jan 13, 2020 6:33 am

NAME Get-StoredCredential



SYNOPSIS

Gets stored credentials from the Windows Credential Store/Vault





SYNTAX

Get-StoredCredential [-AsCredentialObject <SwitchParameter>] [-Target <string>] [-Type <CredType>]

[<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 <CredType>

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



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.String

The command will only return credentials with the specified target





OUTPUTS

PSCredentialManager.Common.Credential



System.Management.Automation.PSCredential





---------- EXAMPLE 1 ----------



PS C:\\> Get-StoredCredential -Target Server01



Returns credentials for Server01 as a PSCredential object



UserName Password



-------- --------



test-user System.Security.SecureString

---------- EXAMPLE 2 ----------



PS C:\\> Get-StoredCredential -Target Server01 -AsCredentialObject



Returns credentials for Server01 as a Credential object



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



RELATED LINKS

Online Version https://github.com/davotronic5000/Power ... Credential