Tag Archives: PowerShell

PowerCLI on the iPhone

Well not quite but the next best thing, I have been putting off getting an iPhone for a while now, I have always been a Windows mobile man starting back with one of the first windows mobile devices around, these were always one step ahead of the other phones when it came to the gadgets and things I wanted to do with a phone.

Recently I have been thinking about getting rid of my HTC Topaz (Diamond II) and succumbing to the iPhone geeks in the office, especially when I saw this…

Sapien Technologies are just about to release the latest version of their iPhone app called “iPowerShell 2.0”, this is a great cmdlet reference, much like my pdf but with all the help files and cmdlets in a nice easy accessible application, how cool is that ! Continue reading →

PowerCLI: Scripting ESXi

As the service console is moved further away from the hypervisor, people are finding it harder to configure ESX in the same way as has been done in previous versions.

Moving forward the only way to do this really is by accessing ESXi through the API using scripting toolkits such as PowerCLI or the Perl toolkit.

There are two basic versions of ESXi “free” and “licensed”, the scripting toolkits are limited to read-only access for the free version of VMware ESXi. When the host is upgraded to vSphere Essentials, vSphere Essential Plus, vSphere Standard, vSphere Advanced, vSphere Enterprise, or vSphere Enterprise Plus these toolkits have write-access enabled and provide a scriptable method for managing ESXi hosts. Continue reading →

PowerCLI: Automating traffic shaping on portgroups

I was contacted by someone who needed to automate some changes to their virtual infrastructure, I can never resist a challenge so of course I agreed to help.

He worked for a Virtual Hosting platform who offer hosting at a low cost of entry.  Each customer where he works is provided with a dedicated  virtual machine, a public IP space in a logical VLAN.   As such his platform is currently 9 hosts, 190 VM’s and 60 Portgroups/VLAN’s. The platform is based on HP c700 Chassis with Cisco 3020 gig switches, with each “half” of the chassis trunked back to our core with a 2Gbps etherchannel. Each Blade’s “production” interface is connected to each “half” of the chassis at 1Gbps with originating VM id based load balancing. Continue reading →

PowerCLI: Comparing Clusters

A simple one-liner for today, I needed to check all our current clusters and ensure all the ‘Production’ clusters were set the same, now we could go to each one and look at the settings but in this wonderful PowerCLI world we live why would you do anything more than once ?

The code is simple:

Get-Cluster | Select Name, * -ExcludeProperty id, CustomFields, ParentId | Sort Name | Out-GridView

The Get-Cluster cmdlet gets all the cluster information and then we simple exclude a few of the items I am not really interested in and then push the output through Out-GridView to display a nice filterable table as below:

Cluster

Continue reading →

PowerCLI: Shutdown your Virtual Infrastructure

Imagine your Power intake to your rack has failed, imagine your UPS has kicked in but is about to run out of power, you need to quickly shut down all of your virtual infrastructure…. quick run !

Or, you could let PowerCLI do the work for you and help you safely shutdown your entire virtual infrastructure, you could even tell your UPS software that when it gets to a certain amount of battery life left that it needs to run this script to safely shut things down.

Continue reading →

PowerCLI: Copying Advanced Host Configuration

I was asked in my script list comments if there was a way to copy the ESX host advanced configuration from one host to every other host in the cluster, thankfully PowerCLI gives us some nice cmdlets to work with that make this task very easy…

Get-VMHostAdvancedConfiguration and Set-VMHostAdvancedConfiguration

So first of all lets list the current advanced configuration of one of our hosts using Out-GridView:

Continue reading →

VESI & PowerGUI PowerPack V3

V3 Nodes

The popularity of this PowerPack never ceases to amaze me, as if it wasn’t enough to have more than 2500 downloads already it was also mentioned by the great Eric Sloof at the recent Dutch VMUG, check out a video of the session here (if you speak Dutch) or check out his slide deck here.

So, I have been working on V3 of the PowerPack and have just finished the final touches.

What’s new ?

To be honest I cant remember everything that is new but as you can see from the left hand node list there are a fair few new nodes which may help in your day to day admin life.

I have not only added my own enhancements but also included a bunch of bug fixes, (thanks Arnim and Luc) and also included some other scripts from Arne over at ICT-Freak.nl

I have re-organised some of the nodes so when you add the latest PowerPack you will receive a prompt like the below:

V3_Move_Nodes

Make sure you click yes to re-organise the nodes into the new areas.

I have also made a dependency on PowerCLI V4.0 Update 1 so if you do not have that version installed then please install it before upgrading to the latest PowerPack, you will not need vSphere 4.0 U1 as PowerCLI 4.0U1 is backward compatable.

In the latest version of PowerCLI VMware have made the connection methods a million times better, if you look at the code you will now see how easy it is to paste your new code into the nodes and create your own enhancements.

So what’s next for V4 ?  More of the same great scripts, more enhanced nodes, a move towards more actions and less nodes, and I am also thinking about opening this up as a community project, we can all add our own scripts to the PowerPack as a community effort and make this THE ULTIMATE FREE TOOL to have when administering or consulting VMware systems, express your interest via the comments please.

If your not a scripter but would like to see something in the PowerPack to make your life easier also please let me know via the comments.

Use the automatic update feature or download the new version now from below.

Local Plugin Creator

Recently VMware are adding everything into vCenter to be centrally managed, apart from my PowerCLI prompt I think the vSphere Client is the second most launched application on my computer !

Now wouldn’t it be useful if you could add your other management interfaces into the vCenter Client, even if the vendor hasn’t created a plugin…

One App to rule them all, One App to find them,
One App to bring them all and in the vSphere Client bind them.

Sorry, couldn’t resist it. Continue reading →

PowerCLI Quick Reference Guide

Way back in the days of the “Virtual Infrastructure Toolkit” I released a quick guide for people to keep on their desk or in their pocket, the idea was it would give you enough information about the VITK whilst still being on a single (double sided) page.

Well things have moved on and the days of the VITK are no more, now we have PowerCLI and aren’t we pleased !

So to keep us up to date and so that we still have a quick reference, I have updated the single sheet to include all the new cmdlets and I also threw in a few other resources too.

Please download, print off and fold, keep it with you to help with your day to day usage of  PowerCLI (or is that just me ?!?). Continue reading →

Exploring the PowerCLI cmdlets – Get-NicTeamingPolicy Part 2

In my previous post “Exploring the PowerCLI cmdlets – Get-NicTeamingpolicy” I showed you how to output some great looking information for vSwitches which detailed all the information we may ever need to know, so whilst on the same cmdlet lets look at PortGroups, these have the same type of settings and the same cmdlet also works against a PortGroup object, as before we can display this information with a single one liner… Continue reading →