Sending VM keystrokes using vRealize Orchestrator
| 1 minute
VMware vRealize Orchestrator Javascript How-To vRealize Suite

Last year the legendary William Lam (Virtually Ghetto) posted a handy Powershell script that can use the vSphere 6.5 API’s to send keyboard key strokes to a VM (https://www.virtuallyghetto.com/2017/09/automating-vm-keystrokes-using-the-vsphere-api-powercli.html).

I recently had a need for this feature but in vRealize Orchestrator and in Javascript instead of Powershell so I’ve re-written it in Javascript. I’ve included 2 additional script blocks that you can place into Scriptable Tasks or Actions too.

Send a string as VM keystrokes to a VM Console

You’ll need the following input parameters defined:

  • Name: ‘vm’
    • Type: VC:VirtualMachine
  • Name: ‘string’
    • Type: String

Send CTRL+ALT+DELETE to a VM Console

You’ll need only one input parameter defined:

  • Name: ‘vm’
    • Type: VC:VirtualMachine

Send the carriage return keystroke to a VM Console

You’ll need only one input parameter defined:

  • Name: ‘vm’
    • Type: VC:VirtualMachine

I hope you find this as useful as I did.

A huge thanks to William Lam for the source.

About Stellios Williams
Senior Cloud Solutions Architect - Service Providers VMware
This is my personal tech related blog for anything private and public cloud - including homelabs! My postings are my own and don’t necessarily represent VMware’s positions, strategies or opinions. Any technical guidance or advice is given without warranty or consideration for your unique issues or circumstances.
Comments
comments powered by Disqus
Advertisement