{"id":76413,"date":"2016-02-01T11:59:00","date_gmt":"2016-02-01T11:59:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2016\/02\/01\/powertip-get-password-from-powershell-credential-object\/"},"modified":"2019-02-18T09:20:02","modified_gmt":"2019-02-18T16:20:02","slug":"powertip-get-password-from-powershell-credential-object","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/powertip-get-password-from-powershell-credential-object\/","title":{"rendered":"PowerTip: Get password from PowerShell credential object"},"content":{"rendered":"<p><b>Summary<\/b>: Learn how to retrieve the password from a Windows PowerShell credential object.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Question\" \/>\u00a0I 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?<\/p>\n<p style=\"margin-left: 30px\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Answer\" \/>\u00a0Assuming you have permissions to the object, you can use the\u00a0<b>GetNetworkCredential<\/b>\u00a0method, for example:<\/p>\n<p style=\"margin-left: 120px\">$a = Get-Credential<\/p>\n<p style=\"margin-left: 120px\">$a.GetNetworkCredential() | fl *<\/p>\n<p style=\"margin-left: 30px\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/7610.Dr.ScriptoForTips.jpg\" alt=\" \" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Learn how to retrieve the password from a Windows PowerShell credential object. \u00a0I 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? \u00a0Assuming you have permissions to the object, you can use the\u00a0GetNetworkCredential\u00a0method, for example: $a [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[568],"tags":[356,3,45],"class_list":["post-76413","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hey-scripting-guy","tag-powertip","tag-scripting-guy","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Learn how to retrieve the password from a Windows PowerShell credential object. \u00a0I 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? \u00a0Assuming you have permissions to the object, you can use the\u00a0GetNetworkCredential\u00a0method, for example: $a [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/76413","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=76413"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/76413\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=76413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=76413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=76413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}