Export-Xlsx, the sequel, and ordered data

Some time ago I published the Export-Xls function to the world in my Beyond Export-Csv: Export-Xls post. And it has been one of the more popular functions on my blog.

PS-2-Excel

Just before Christmas 2012 I got a comment from Gilbert where he informed me that he had written an Export-Xlsx function and had borrowed some of the parameters that were on the original Export-Xls function. We exchanged a couple of emails with suggestions and ideas, and yesterday the finalised Export-Xlsx function was posted on Gilbert’s ITPilgrims blog (which you should follow btw) in his Export-Xlsx post.

In this post I will publish this new Export-Xlsx function with some annotations, and I will also show how you can now export your data in the order you want, provided you’re using PowerShell v3.

Continue reading Export-Xlsx, the sequel, and ordered data

Game of Nines – VM Uptime Report

The end of the year is near again. Time to plan for the new, but also a time to look back on what was there in the past year.

Your vSphere environment is no different. It is time to produce some of those dreaded year reports that will show you how your environment has been doing. And one of the aspects a lot of people are very keen about, is the number 9 game 😉

Game-of-Nines

What was the uptime of the VMs you had running ?

The question popped up on several occasions in the PowerCLI Community as well. So I guess I was not the only one that was looking for a way to calculate the uptime of Virtual Machines.

Bug alert ?: it seems that the PerformanceManager handles vMotions in a strange way. After a vMotion the sys.uptime.latest is reset to 0 (zero). That is understandable, since the VM is now running on a different ESXi host. But it seems that the aggregated metric do not add up all the sys.uptime.latest metrics from different ESXi hosts. So when you use DRS or do vMotions yourself, the produced report will have some serious flaws !

Continue reading Game of Nines – VM Uptime Report

ThinApp 4.7 Essentials book – Win your free copy !

I already mentioned the ThinApp 4.7 Essentials book by Peter Björk in a previous post on this blog, and now thanks to Packt Publishing I can offer 2 copies of the book to the lucky winners of a small competition.

The rules for the competition are straightforward.

How you can win:

To win your copy of this book, all you need to do is come up with a comment to this post highlighting the reason “why you would like to win this book”.

Please note: Only winners residing n the USA and Europe would get a chance to win print copies. Others would be provided with eBook copies.

Duration of the contest & selection of winners:

The contest is valid for 7 days, and is open to everyone. Winners will be selected on the basis of their comment posted.

On Monday December 10th 2012 09:00 CET the comments will be closed.


The winners of the ThinApp 4.7 Essentials book are NiTRo and Michael.
Congratulations !

And since this blog is about PowerShell, the winners were selected as follows:

Thanks to all participants.

Monitor the size of your vDisks

In a recent thread on the VMTN PowerCLI Community someone asked if it is possible to get historical hard disk statistics. I referred the user to my Datastore usage statistics post, where I showed how to use the “disk” metrics to get that information.

But getting the individual vDisk statistics is a bit more tricky compared to getting the datastore statistics, as I showed in that post. The “disk” metrics hold the information, but the Instance that points to the MoRef value of a VM makes it a bit more tricky to retrieve.

Be forewarned, the “disk” metrics hold usage data for all the vDisks that a specific VM has on a specific datastore. You will not be able to get individual vDisk statistics, unless the vDisks are stored on different datastores !

On the positive side, the “disk” metrics will allow you to see how your vDisks increase in size over time. For your Thick vDisks that increase will be by expanding them, and for your Thin vDisks it will also show the natural growth.

Continue reading Monitor the size of your vDisks

ThinApp cleanup with ExcludePattern

The last couple of days there was quite a bit of ThinApp news !

Time to post another ThinApp-PowerShell function.

Continue reading ThinApp cleanup with ExcludePattern

Work with E1000E NICs in PowerCLI

Now that Windows 8 and Windows Server 2012 are readily available , we all want to do some exploring. But if you want to automate the creation of some test VMs for this, you are in for a surprise.

The current PowerCLI 5.1 Release 1 doesn’t accept the E1000E NIC as a Type on the New-NetworkAdapter cmdlet. Users start hitting this limitation, as can be seen on this PowerCLI Community thread. You can go for the E1000, but why settle for less if you can easily script the use of the E1000E NIC from PowerCLI?

So even though Eric “the Scoop Meister” Sloof debunked the myth that the E1000/E1000E is faster than the VmxNet3, the E1000E is the default NIC type that vSphere gives you when you create a VM for a Windows Server 2012 or Windows 8 VM. Note that the E1000 apparently uses slightly more CPU resources than the E1000E. With the function in this post you can now automate this behavior.

Update November 17th 2012: In KB2006859 it seems to say that the VMXNET3 NIC doesn’t work with Windows Server 2012 or Windows 8. And there have been several blogs (including mine) that picked up this info. But after you apply the September 2012 patch to your ESXi servers, you can also use a VMXNET3 NIC for both Windows OS. See here and here for more info.

Thanks to reader alcapapower for drawing my attention to this (see his remark in the comments below).

Continue reading Work with E1000E NICs in PowerCLI

My favorite PowerShell editor is free now!

I rarely post about products, since I want to keep my blog “technical“, but there was some big news from Idera today.
As from version 4.6, their famous PowerShell Plus editor is now a free tool.

This is the editor I have been using to write, and debug, my PowerShell and PowerCLI scripts since day 1.

It would take me several pages to list the features I like and use in PowerShell Plus, but there are 2 that were ‘love at first sight’ for me; the Debug mode and the Variables pane. You can’t go without those when you are writing a script.

So why not give it a try, it’s for free now 🙂

What’s in the View AD-LDS ?

For those that are working with VMware View it is probably common knowledge that View stores information about the virtual desktop infrastructure configuration in an AD-LDS (Active Directory Lightweight Directory Service) on the Connection Servers. An AD-LDS, previously known as ADAM, is an embedded LDAP directory.

Since the current PowerShell snapin that comes with VMware View is seriously lacking functionality, and doesn’t integrate too well with the PowerCLI snapin, there are several View administrators out there, that look at this AD-LDS to help them manage their View environment.

I will list a number of existing scripts that use the AD-LDS to retrieve View related information. But most of the time these scripts go for only part of the available information.

Continue reading What’s in the View AD-LDS ?

Update a remote server to ESXi 5.1

With my new HaaS based home lab, I experience some limitations I need to live with. There is for example no way to insert a CD or DVD, nor can I use any USB key or a network boot.

That means that some of the procedures I have been using since long, need to be reviewed and updated. The next post describes one of the practical problems I encountered.

How do you remotely upgrade an ESXi server to version 5.1 ?

But as you can imagine, everything is “posh“-able. I was able to automate a manual procedure, and more important, I was able to upgrade my ESXi server to 5.1.

Continue reading Update a remote server to ESXi 5.1

Belgian VMUG event #17, the “Blogger Edition”

Today was a historic day for the Belgian VMUG.

The 17th edition, the so-called “Blogger Edition“, was completely sold out. All 170 attendees, a new record, had a great day and the presenters  all gave a peak performance. The list of presenters was impressive to say the least.

I was honored to have been selected to do a presentation as well. Since it was in Belgium, I decided to give the subject of my session a local twist. The subject was PowerCLI and beer, you can’t live without them.

You’ll be missing the story I told during the presentation, but on request, the slides.

Update: all presentations are now available here (requires a VMUG account).

Continue reading Belgian VMUG event #17, the “Blogger Edition”