Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect request to server #66

Open
ghost opened this issue Jun 6, 2018 · 6 comments
Open

Incorrect request to server #66

ghost opened this issue Jun 6, 2018 · 6 comments

Comments

@ghost
Copy link

ghost commented Jun 6, 2018

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
Copy link
Owner

lamw commented Jun 6, 2018

What version of vSphere are you using? The API is only supported with 6.5 or greater

@ghost
Copy link
Author

ghost commented Jun 7, 2018

The vSphere Web Client is 6.5.

@ghost
Copy link
Author

ghost commented Jun 7, 2018

Also, to give you more information on the issue - I can see the tasks for "Put USB HID scan codes" in the Task & Events section of the VM I am trying to target.

image

@lamw
Copy link
Owner

lamw commented Jun 7, 2018

Are you constantly getting this error using any string input? Can you try with another VM to see if its successful?

@ghost
Copy link
Author

ghost commented Jun 7, 2018

I have tried with multiple VMs with different OS and yes, any string input.

@lamw
Copy link
Owner

lamw commented Jun 7, 2018

To rule out VC, can you try directly to an ESXi host to verify the script is working for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant