- 1 year ago
plaintext credentials are showing in window event logs when connected to vcenter using powershell
Comment
1 / 1
It is not recommended to store plaintext credentials in Windows Event Logs as it can pose a security risk. To avoid this, you can use PowerShell SecureString to store the credentials in an encrypted form.
Here's an example of how you can use SecureString to store credentials in PowerShell:
bash$username = "username"
$password = ConvertTo-SecureString "password" -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential ($username, $password)
You can then use this $credential
object to connect to vCenter, without revealing the plaintext password in your code or in the Windows Event Logs.