New book – Learning PowerCLI – Second Edition

Learning PowerCLI - Second Edition CoverToday, my new book Learning PowerCLI – Second Edition was published by Packt. Learning PowerCLI, Second Edition will learn you to leverage the power of PowerCLI to automate your VMware vSphere environment with ease.

Starting with an introduction to the basics of PowerCLI, the book will teach you how to manage your vSphere and vCloud infrastructure from the command line. To help you manage a vSphere host overall, you will learn how to manage vSphere ESXi hosts, and deploy and upgrade ESXi hosts using Image Builder and Auto Deploy.

The upcoming chapters will not only teach you how to create datastores and datastore clusters, but you’ll also work with profile-driven and policy-based storage to manage your storage. To create a disaster recovery solution and retrieve information from vRealize Operations, you will learn how to use Site Recovery Manager and vRealize Operations respectively.

Towards the end, you’ll see how to use the REST APIs from PowerShell to manage NSX and vRealize Automation and create patch baselines, scan hosts against the baselines for missing patches, and remediate hosts. By the end of the book, you will be capable of using the best tool to automate the management and configuration of VMware vSphere.

Compared to the first edition, Learning PowerCLI – Second Edition is updated to vSphere 6.5 and PowerCLI 6.5. Learning PowerCLI – Second Edition contains five new chapters about vSphere Update Manager, vCloud Director and vCloud Air, Site Recovery Manager, vRealize Operations Manager, and using REST API to Manage NSX and vRealize Automation. Read more of this post

New VMware fling: Onyx for the Web Client

PowerCLI logoVMware Onyx has been a very popular fling for many years. You can use Onyx to create PowerCLI code by performing actions in the VMware vSphere client. The created PowerCLI code does exactly what you did in the client. The PowerCLI code can easily be adapted to your own needs.

Unfortunately Onyx was not available for the vSphere Web Client. This was a pitty because since vSphere 5.1, new features were not built into the vSphere client. So you could not use Onyx to create PowerCLI for the new vSphere features. I am very happy that VMware now has released a new fling: Onyx for the Web Client. Read more of this post

Function to speed-up the execution of the first PowerCLI cmdlet

PowerCLI logo
Last year there was a post on the PowerCLI Team blog called How to speed-up the execution of the first PowerCLI cmdlet. That post showed commands you need to execute to pre-compile some of the PowerCLI code to prevent this from being done in every PowerCLI session.

Running these commands will speed-up the execution of the first PowerCLI cmdlet you run in your session. The blog post was made before PowerCLI 5.0 was released and didn’t show the commands to speed-up PowerCLI 5.0. Later there was a post at the vNugglets blog Speed Up First PowerCLI 5 cmdlet — Precompile XMLSerializers that shows the commands needed for PowerCLI 5.0.

But what happens when PowerCLI 5.1 or 6.0 is released? Of course we can try to find the new commands needed to speed-up PowerCLI every time a new version is released. But would it not be easier if we have a function that will do this for you?

The Install-PowerCLIXmlSerializer function presented in this post will show you a PowerShell function that you need to run once after you install a new PowerCLI version to speed-up the execution of the first cmdlet every time you run PowerCLI. Read more of this post

Check your vSphere cluster hosts patch level with PowerCLI

PowerCLI logoIt is a best practise to keep all the hosts of a VMware vSphere cluster at the same patch level. That means that all the hosts need to have the same patches installed. But how do you easily check if this is the case? This is where PowerCLI will help you. Read more of this post

How to use VMware vSphere PowerCLI to find a virtual machine by MAC address

PowerCLI logoSometimes you need to find a virtual machine by MAC address. This can be very time consuming if you have to do this by hand using the VMware vSphere Client. PowerCLI can do this task for you in only a few seconds. The script presented in this blogpost will retrieve the virtual machine that has a certain MAC address. Read more of this post

How to use VMware vSphere PowerCLI to find an ESX/ESXi server by MAC address

PowerCLI logoIn “Virtual machine failed to power on” Monique Vanmeulebrouk describes a problem where in one stage she needed to find an ESX server that has a certain MAC address. Of course you can log in to all your ESX servers and issue the “ifconfig | grep -i hw” command as described in the VMware Knowledge base article “Identifying the ESX Service Console MAC address”. But this method takes a lot of time. You can do this much easier with VMware vSphere PowerCLI. Read more of this post

How to add a PowerShell script to your WordPress.com blogpost

WordPress logoAfter starting this blog two weeks ago, I wrote a post that contains a PowerShell script. But I still have not published this post, because I could not find a good way to include the PowerShell script in my post.

I saw that a lot of other blogs use the SyntaxHighligter plugin by Alex Gorbatchev. But I thought that you needed to have a WordPress.org blog to be able to upload plugins. And this is a WordPress.com blog where uploading plugins is not possible. Read more of this post