Difference between revisions of "Creating a PSCredential object"

From MyWiki
Jump to: navigation, search
(Created page with "<source="text"> $secpasswd = ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force $mycreds = New-Object System.Management.Automation.PSCredential ("username", $secpa...")
 
Line 1: Line 1:
<source="text">
+
<source lang="text">
 
$secpasswd = ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force
 
$secpasswd = ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force
 
$mycreds = New-Object System.Management.Automation.PSCredential ("username", $secpasswd)
 
$mycreds = New-Object System.Management.Automation.PSCredential ("username", $secpasswd)

Revision as of 21:22, 8 November 2014

$secpasswd = ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential ("username", $secpasswd)
 
You can now pass $mycreds to any -PSCredential input parameter