I am happy to announce that the very popular fling ‘PowerActions for vSphere Web Client’ is now available for vSphere 6!
What’s New
PowerActions 1.5.0 now works with vSphere 6 and PowerCLI 6. This means the requirements differ from the previous version:
- .NET Framework 4.5 is now supported
- PowerShell v2, v3, or v4 can be used
- PowerCLI 6.0 is now supported
Upgrade Process
- If you already have PowerActions installed, in order to upgrade, you must first uninstall the current version as per the steps above and then do a fresh install of the new version.
- ‘My Scripts’ has now been moved into the C:\ProgramData\VMware\PowerActions\Scripts folder so make sure you backup the old scripts and then move them to the new location.
Already running PowerActions 1.0? Click HERE to download the latest version!
What is PowerActions?
PowerActions integrates the vSphere Web Client and PowerCLI to provide complex automation solutions from within the standard vSphere management client. In short, we can now run PowerShell/PowerCLI scripts from the Web Client!
How does it work?
PowerActions is a vSphere Web Client Plugin that allows users to run PowerCLI scripts from the vSphere Web Client interface. These commands are sent to a separate machine running PowerCLI and the PowerActions software. The PowerActions Plugin includes two menu items on the homepage of the Web Client as well as a PowerCLI menubar item when the user right-click’s on objects within the web client (read more below).
What are the Requirements?
The requirements are pretty straightforward and simple:
- VMware vSphere 5.1 to 6.0 (Earlier than 5.1 has not been tested)
- PowerShell Host Machine
- Windows 2003 Server or newer (*)/Vista or newer
- .NET 4.0 or 4.5
- PowerShell v1, v2, v3, or v4
- PowerCLI version supporting your current VMware vSphere version
- Administrative privileges (registering a service with VMware Lookup Service and creating a user for SSO) are required for installation, but not for use of the product.
- Prior to installation, ensure that the PowerShell Host machine and the machine hosting the VMware Lookup Service are synced via the same time source, otherwise cryptic error messages may appear.
Installation
In my case I went ahead and deployed a new Windows Server 2008r2 Virtual Machine.
I then had to install PowerCLI. I went ahead and installed the latest version of PowerCLI.
***Note*** Make sure to run PowerCLI as administrator after it is installed and run:
Set-ExecutionPolicy RemoteSigned
If the execution policy is not changed from it’s default, the PowerCLI Console in the Web Client will not function. /***Note***
Once I had my virtual machine ready (All of my Prerequisites have been satisfied to this point), I’ll go ahead and run the PowerActions executable.
The PowerActions interactive install wizard will pop up. Click ‘Next’
Look at the License Agreement, then check the “I accept the terms in the License Agreement”
You can go ahead and use the defaults on this page. Click ‘Next’
On this page you’ll want to add the FQDN of the current machine. In my case, it’s ‘controlcenter.corp.local’.
On this screen, you will need to enter the Lookup Service URL, SSO username, and SSO Password.
The Lookup Service URL will be https://yourvcenter:7444/lookupservice/sdk
click ‘Install’.
Once the installation finishes we’ll be ready to roll.
Show me the magic!
Now that we’ve completed the installation we can login to the vSphere Web Client. You will now see two new menu items on the left-hand side of the screen. ‘PowerCLI Console’ and ‘PowerCLI Scripts’.
Clicking on the PowerCLI Console button will bring up just that, a PowerCLI Console for running commands (did I just hear all Mac and Linux users shout for joy??).
running ‘get-vm’ returns everything it would from run PowerCLI on a windows machine.
If we go to the PowerCLI Scripts menu item it brings us to a script repository. This area allows users to save personal scripts as well as setup shared scripts. This is a fantastic capability to have a repository of scripts that can be run by you and/or others without duplicating efforts. You can see I’ve already added in a few scripts.
To add a script click the “create a script” icon below the “MyScripts” dropdown.
The scripts are organized by object. Decide which object the script will be used for (this is important as when you click on a vSphere object, the scripts that appear to run are only those that are linked to that object type).
Name your script, give it a description, and select either Action or Report (is your script DOING something or Reporting)
In this screen, we can add our code for this script. Add it below the param line. The $vParam is where the object that is right-clicked in the Web Client is stored. For example (you’ll see in my screenshots below as well) I right-click a cluster ‘Main-CL’ and run the following script on it. Because I right-clicked ‘Main-CL’ that object is than saved in $vParam. $vParam can then be used later on in your script as well.
The final page allows you to review all the information you’ve entered in this wizard. If you are satisfied, click ‘Finish’
We can then navigate to specific objects within the Web Client, right-click the object, hover over PowerCLI, and click ‘Execute Script’
Select the script you want to run, click ‘Ok’.
The script will run and the results are returned in a nicely formatted manner. you can click on the “Export Page” button in the bottom-right if you want to save your results.
Downloads
PowerActions can be downloaded HERE
Conclusion
This article just scratches the surface on the capabilities of PowerActions. I am excited to see where the community takes this and the types of scripts that will start appearing around the web. The ability for Linux and Mac users to now run PowerCLI commands without having to be running on a Windows machine should make many users elated. Give PowerActions a shot and give them your feedback!
For a great video on this new fling check out Alan Renouf’s post on PowerActions HERE