Is there a (modern) way to connect to vCenter server securly without using files or passwords in clear text, when creating a scheduled task in Windows? Or is there some better way to store and schedule powercli scripts?
It's been a few years since I did this, and back in the day we used to store the password in a file (http://technodrone.blogspot.com/2012/05/creating-and-storing-powershell.html), but I doubt this is entirely without risk.
The "modern" way seem to be to use New-VICredentialStoreItem, to store it in but this comes with a pretty big caveat: -Password parameter is "string", so the password is also stored in powershell history which is not ideal. The tests I've done with Get-Credential and SecureString has not worked, but is there a way to not have them in the history in clear text?
Can't you somehow use the credentials specified when creating the scheduled task?
The more secure methods currently are based on the SecretManagement and SecretStore modules.
Kamen recently wrote a blog post on it, see Managing VICredentials on PowerShell 7 using VMware.VISecret Module!
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
The more secure methods currently are based on the SecretManagement and SecretStore modules.
Kamen recently wrote a blog post on it, see Managing VICredentials on PowerShell 7 using VMware.VISecret Module!
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks Luc, you're the best as always! This is exactly what I was looking for.