Credentials: Unterschied zwischen den Versionen
Aus Wiki-WebPerfect
Admin (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „ == Store password in a script (no Plaintext) == <span style="color:red">Important!: It only works if it is created '''on the same server as it is running.'''…“) |
Admin (Diskussion | Beiträge) K |
||
Zeile 1: | Zeile 1: | ||
== Store password in a script (no Plaintext) == | == Store password in a script (no Plaintext) == | ||
− | <span style="color:red"> | + | <span style="color:red">IMPORTANT: It only works if it is created '''on the same server as it is running.''' </span> |
<source lang="powershell"> | <source lang="powershell"> |
Version vom 26. Januar 2018, 10:02 Uhr
Store password in a script (no Plaintext)
IMPORTANT: It only works if it is created on the same server as it is running.
$Username = '<username>' $Password = '<password>' $SecurePassword = ConvertTo-SecureString -AsPlainText $Password -Force $Credentials = New-Object System.Management.Automation.PSCredential -ArgumentList $Username,$SecurePassword