VMware Cloud Community
LittleNickey
Enthusiast
Enthusiast
Jump to solution

Windows Task Scheduler connect securely

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?

-- Oskar
Labels (1)
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

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

0 Kudos
LittleNickey
Enthusiast
Enthusiast
Jump to solution

Thanks Luc, you're the best as always! This is exactly what I was looking for.

-- Oskar
0 Kudos