Created
June 27, 2017 18:38
-
-
Save techthoughts2/d25079fc016ea752af5ed1c2e4bd0080 to your computer and use it in GitHub Desktop.
Create a secure credential object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$PASSWORD = 'password' | |
$user = "domain\user" | |
$secureString = ConvertTo-SecureString -AsPlainText -Force -String $PASSWORD | |
$credential = New-Object ` | |
-TypeName System.Management.Automation.PSCredential ` | |
-ArgumentList $user,$secureString |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment