Credentials

Aus Wiki-WebPerfect
Version vom 26. Januar 2018, 10:02 Uhr von Admin (Diskussion | Beiträge)

(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu: Navigation, Suche

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