plaintext credentials are showing in window event logs when connected to vcenter using powershell

267 Views Asked by At

@powershell @vcenter

I have connected to vcenter with encrypted password as below. But still my plaintext password is getting logged in event logs.

How can I make my credentials hide in log.

$SecurePassword = ConvertTo-SecureString "P@ssword134" -AsPlainText  -Force                               

Note: Above password "P@ssword134" is not given hardcode. It Will get password using our own API call from UI

$credentials  = New-Object System.Management.Automation.PSCredential ($user,$SecurePassword)

Connect-VIServer "vcenter IP address" -Credential $credentials

Path of logs is event viewer \Applications and Services Logs Microsoft \Windows \Powershell \Operational

Logging is as below:

ParameterBinding(ConvertTo-SecureString): name ="String"; value ="P@ssword134"

This cleatrxt password before encryption's should not showcase in log

Can someone help this issue?

0

There are 0 best solutions below