PowerCLI: Consolidating virtual machine disks

In order to retrieve a list of virtual machines which are reporting t the issue ‘Virtual machine disks consolidation is needed’ we can invoke the Get-VM cmdlet to determine if a virtual machine consolidation is required. $VMs = Get-VM | Where-Object {$_.ExtensionData.RunTime.ConsolidationNeeded} To consolidate snapshots for a collection of virtual machines we can now perform the following, … More PowerCLI: Consolidating virtual machine disks

PowerCLI: Starting and Stopping the SSH service on multiple ESXi hosts

I was recently looking at enabling the SSH service on multiple ESXi hosts in a cluster to invoke a change using remote access, in order to do so I was able to start and stop the SSH service on each ESXi host using PowerCLI. Firstly, I established a connection to the vCenter Server and created … More PowerCLI: Starting and Stopping the SSH service on multiple ESXi hosts

VMware Tools Upgrade fails with vix error code 21009

On remediating virtual machines using the Update Manager, a number of VMware Tools upgrades would fail reporting the following: Error Upgrading VMware Tools vix error code = 21009 On investigation of vix error codes at https://www.vmware.com/support/developer/vix-api/vix16_reference/errors/errors.html there was error code reference for the above. So now it was time to look at the vmware.log file for … More VMware Tools Upgrade fails with vix error code 21009

PowerCLI – Orchestrating bulk advanced setting modifications on a VM

I was recently looking to make an change to the advanced settings of a number of virtual machine to which this required the virtual machine to be powered down in order to apply. Firstly, we will establish a connection to the vCenter system. If (-not (Get-PSSnapin VMware.VimAutomation.Core -ErrorAction SilentlyContinue)) { Add-PSSnapin VMware.VimAutomation.Core | Out-Null } Connect-VIServer server1.domain.local | Out-Null … More PowerCLI – Orchestrating bulk advanced setting modifications on a VM

PowerCLI – Joining an ESXi host to an Active Directory domain

I was recently configuring the Authentication Service on a number of ESXi hosts to join them to an Active Directory domain to manage local user authentication. This is possible using the vSphere Web Client or Client but requires the configuration change to be made on each ESXi host manually and adds an administrative overhead, so lets … More PowerCLI – Joining an ESXi host to an Active Directory domain