Incorrect request to server
Opened this issue · 6 comments
Deleted user commented
After finally figuring out how to run the "VMKeystrokes.ps1" script, I get the following error:
PowerCLI C:\> Set-VMKeystrokes -VMName $VM -StringInput "password" -ReturnCarriage $true
Sending keystrokes to ServerName ...
Exception calling "PutUsbScanCodes" with "1" argument(s): "Cannot complete the
operation due to an incorrect request to the server."
At C:\Projects\Automation\VMKeystrokes.ps1:159 char:5
+ $results = $vm.PutUsbScanCodes($spec)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : VimException
Any idea what might be causing that?
Thanks,
Danni
lamw commented
What version of vSphere are you using? The API is only supported with 6.5 or greater
Deleted user commented
The vSphere Web Client is 6.5.
Deleted user commented
lamw commented
Are you constantly getting this error using any string input? Can you try with another VM to see if its successful?
Deleted user commented
I have tried with multiple VMs with different OS and yes, any string input.
lamw commented
To rule out VC, can you try directly to an ESXi host to verify the script is working for you