September 19, 2016

Execute Remote Script
Example of running a remotely hosted script on a VM. Demonstrates usage of Id() to specify the object to act on, as well as how to pass parameters (script URL) to a service method

package main

import (


var remoteScriptURL = ""

func main() {
    // Create a session
    sess := session.New()

    // Get the VirtualGuest service
    service := services.GetVirtualGuestService(sess)

    // Execute the script on VM with ID 12345678
    err := service.Id(12345678).ExecuteRemoteScript(&remoteScriptURL)

    if err != nil {
    } else {
        fmt.Println("Remote script sent for execution")


We would love to hear it
Open an issue