February 1st, 2016

PowerTip: Get password from PowerShell credential object

Doctor Scripto
Scripter

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 *

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.

Feedback