PowerTip: Get password from PowerShell credential object

Doctor Scripto

Dr Scripto

Summary: Learn how to retrieve the password from a Windows PowerShell credential object.

Hey, Scripting Guy! Question I am having a problem connecting to an application via Windows PowerShell. How can I verify the user name and password that was supplied to the credential object?

Hey, Scripting Guy! Answer Assuming you have permissions to the object, you can use the GetNetworkCredential method, for example:

$a = Get-Credential

$a.GetNetworkCredential() | fl *

Doctor Scripto
Dr Scripto

Scripter, PowerShell, vbScript, BAT, CMD

Follow Dr Scripto   

0 comments

    Leave a comment