I've followed numerous threads shown below regarding using stored credentials and I'm still unable to pass them to the vmconnect command. When I store a credential then use vmconnect like:
vmconnect mypc ubuntu-pc /credential (Get-StoredCredential -UserName bernie)I receive this message regardless of the method used:
"The credential 'System.Management.Automation.PSCredential' is not in the credential store"
I also tried manually adding credentials using the Windows 10 credential manager.
How can I use a stored credential with the vmconnect command?
Methods Tried:
2 Answers
Try using cmdkey instead. Store the user/pass like this:
If on domain
cmdkey /generic:domain\server /user:domain\bernie /pass:1234
and if not on a domain:
cmdkey /generic:.\server /user:.\bernie /pass:1234 (can also replace dot with local machinename)
After this has been added run cmdkey /list and look at the bottom entry for value Target=.
Next, connect with vmconnect like:
VmConnect.exe "mypc" "ubuntu-pc" /credential LegacyGeneric:target=.\bernie
The last target= parameter will be whatever the value returns when you run cmdkey /list
1You can simply use the regular Remote Desktop Connection to connect to the VM.
It might require some fiddling based on how you've set up your VM and the network between the host. I don't exactly remember which one helped me (been at it for days) but some of these definitely helped: