PowerShell/SMA/WAP: Controlling LEGO Mindstorms EV3 from PowerShell/SMA Runbook – Part 1 – The Runbook

A few weeks ago i posted the video about my demo of the LEGO Mindstorms robot, controlled by a Runbook inside the Service Management Automation section of Windows Azure Pack

The video has been seen by many people and i have gotten so much great feedback!

Multiple people have asked me of “How did you do that?”

I have decided to do a multi part post, first posting the details, then more guides to how to do the different setup tasks

Part 1 – SMA Runbook, Overview + Setup

Part 2 – How to setup a variable asset in SMA (Robot Com port value)

Part 3 – How to setup a connection asset in SMA (Robot Server conneciton)

First the Video:

URL: http://youtu.be/1Al-dY-DHlw

Blog post: https://blog.ctglobalservices.com/?p=7308

and here is how to do it!

Setup Robot connection and asssemblies

  1. Build the LEGO Robot using the build manual!
  2. Pair the robot to a computer which has PowerShell Remoting enabled.
  3. Open Bluetooth settings and check the com port number of which is the outgoing port to EV3. (COM10 in this example)


  1. Download the LEGO Mindstorms EV3 .net library from CodePlex here
  2. Place the Desktop assembly, Lego.Ev3.Desktop.dll, on the computer. Note the location for use later.

Setup Service Management Automation Runbook

  1. Logon to Windows Azure Pack administration site
  2. Create a mgmt server connection asset called RobotServer (How to, will be explained in Part 3)
  3. Create a setting asset, called RobotPort. This is a string asset with the value of the COM port of which the robot is connected via bluetooth (COM10 etc.) (will be explained in Part 2)
  4. Edit the New-Robotnotification workflow to make sure the Path to the Lego.Ev3.Desktop.dll assembly is correct.
  5. Import the New-RobotNotification runbook/workflow to SMA.
  6. Publish the runbook.
  7. Start the runbook and provide directory (Left/Right)
  8. Wait for the magic to happen!

Download the workflow here:

Download “New-RobotNotification.zip” New-RobotNotification.zip – Downloaded 163 times – 1 KB

or copy paste the code from below:

Have fun!

and please dont hesistate to comment or contact me about ideas/fixes/anything related to system center or Windows Azure Pack

By | 2017-08-22T09:25:52+00:00 March 24th, 2014|Automation, Windows Azure Pack (WAP)|4 Comments

About the Author:

Jakob Gottlieb Svendsen

Twitter: @JakobGSvendsen

Jakob Gottlieb Svendsen is a Microsoft Cloud and Data Center Management MVP (http://mvp.microsoft.com/en-us/default.aspx), Working as Global Lead Developer, Senior Consultant and Trainer at CTGlobal, where he is one of the driving forces in keeping CTGlobal a System Center Gold Partner and member of the System Center Alliance.

Since he started at Coretech in 2007, he has focused on Scripting and Development, primarily developing tools, extensions and scripts for the System Center Suite. His main area is Automation (including OMS/Azure Automation, Service Management Automation, PowerShell and Orchestrator). Another area is Windows Azure Pack / Azure Stack, where he does implementation, development, workshops and presentations. He is a world-wide renowned voice in the Automation field.

He is passionately devoted to the community, to which he contributes by being a moderator at TechNet and sharing his knowledge at https://blog.ctglobalservices.com/jgs

  • Co-founder: PowerShell User Group Denmark
  • Speaker at MMS 2016, Minneapolis (www.mmsmoa.com)
  • SCU Europe 2014, 2015, 2016 (www.systemcenteruniverse.ch)
  • Microsoft TechEd North America 2014, Houston
  • NIC 2012,2013,2014,2015, Oslo (www.nic.com)
  • Microsoft CampusDays 2011, 2013, Copenhagen
  • Microsoft TechDays 2015, Sweden (www.techdays.se)
  • Microsoft Partner Event: New in SC2012 SP1
  • User group meetings (PSUG.DK , SCUG.DK/BE/NO, AZMUG + more)
  • Microsoft Certified Trainer.
  • Microsoft Scripting Guys Forum Moderator

Main working areas:

  • Automation (Azure Automation, SMA, SCO)
  • Windows Azure Pack / Azure Stack
  • System CenterVisual Studio Team Services / Team Foundation Server
  • Development:C#.Net, VB.NET, VBScript, PowerShell, Service Manager, OpsMgr, ConfigMgr
  • Orchestrator
  • Windows Azure Pack / Azure Stack


  • Azure Automation
  • Service Management Automation
  • System Center Orchestrator
  • PowerShell, VBScript, C#.Net, VB.Net
  • Windows Azure Pack / Azure Stack Development Workshops


  1. Viswanatha Swamy May 28, 2014 at 15:53 - Reply


    How will Azure Automation knows that from where it should pickup the .dll. I have to load CloudStorageClient.dll. Please advice. Many thanks!

    Viswanatha Swamy

  2. Morten August 23, 2017 at 10:12 - Reply

    Lego rocks!

  3. get social signals September 8, 2017 at 7:51 - Reply

    get social signals

    wpccqdlpp cdgso cquvhwu lows fgeamhrwxciybbv

Leave A Comment