PowerCLI Group Discussion

VMworld PowerCLI Group Discussion–Part 3–Launching and Using


Following on from the previous posts in this series, this post will take us through the group discussion held at VMworld this year and expand on the items noted during the session.

This post will focus on what people in the session used PowerCLI for and also the various ways people used to launch the scripts.

The other posts in this series can be found below:

What were people using PowerCLI for?

  1. PowerCLI can be used to easily identify machines with snapshots and manage these snapshots on mass, easily remove the snapshots over a certain amount of days old or report on who created the snapshots, how long they have been around for and how much space they are using.
  2. PowerCLI can be used for finding attached drives, CD-Roms, Floppy drives, the kind of things that stop vMotion from working, in fact, did you know that this was the original use case for PowerCLI ?! My how it has grown!
  3. PowerCLI was being used to cross check information in a CMDB by direct access to the database or API to pull the information and relate it back to the VM, or maybe the other way around, take the VM or host information and store it into the CMDB for further info.
  4. PowerCLI can also be used to manage VMware View, many people in the discussion were using it to manage Pools.
  5. Deploy VMs, not just one but hundreds, with a single line of code PowerCLI can be used to instantly deploy VMs on mass.
  6. PowerCLI can be used to configure your hosts, obviously Host Profiles is easier to use in an enterprise environment and will take less maintenance but a good PowerCLI build script can go far.

How are people running PowerCLI scripts?

  1. PowerGUI is not just a script editor, it has a MMC style interface which runs PowerShell scripts underneath.  There is a VMware PowerPack from Quest (or whoever owns them now) and also a community PowerPack with lots of great additions already in there.
  2. You can run PowerCLI from an Excel Macro, this is a great way to create a simple form with Excel cells for entry, then in the macro use the cells as input to run a PowerCLI script.  Some of these can look great and be an easy way to allow others to use your scripts.
  3. Windows Task Scheduler can be used to schedule your PowerCLI scripts, tasks which need to run on a timed basis can be setup and forgotten, email output is a great way to pass off results at the end of a scheduled script.
  4. PowerCLI can be launched as part of a vCenter alarm, this is a great way to run scripts on a certain condition like a VM being created or a host being added to vCenter or maybe a datastore running out of space. Find out how here.
  5. Guest Scripts can be launched using the Invoke-VMScript cmdlet, this is great for reaching inside your VMs to further the automation or return results needed on the guest OS.
  6. WebCommander is a great fling that allows you to launch scripts at the single click of a button, check it out here.

4 thoughts on “VMworld PowerCLI Group Discussion–Part 3–Launching and Using

  1. Pingback: VMworld PowerCLI Group Discussion–Part 1–Getting Started - Virtu-Al.Net

  2. Pingback: VMworld PowerCLI Group Discussion « Nigel Boulton's Blog

  3. Pingback: VMworld PowerCLI Group Discussion–Part 4–Advanced tools and scripting | Virtu-Al.Net

  4. Pingback: VMworld PowerCLI Group Discussion–Part 3–Launching and Using – Luca Donetti Dontin | Blog

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.