Tag Archives: powercli

PowerShell script to get VMs and their datastores from an offline VMware ESXi host via vCenter

I recently had the local storage controller fail in one of my ESXi hosts. The host carried on running, and the VMs on it carried on running, but it wasn’t very happy. It was unresponsive via the vSphere client, and … Continue reading

Rate this:

Posted in PowerShell, vSphere | Tagged , , , , , , , , | Leave a comment

Add and remove VMware NFS datastores via PowerCLI

Been experimenting with these recently, and they have to be added to or removed from each host individually, which is tedious via the GUI. Easy via PowerShell/PowerCLI though. Add: $hosts = Get-VMHost -Location “RCM” foreach($VMHost in $hosts){ Write-Host $VMHost.Name New-Datastore -VMHost … Continue reading

Rate this:

Posted in PowerShell, vSphere | Tagged , , , , , , , , | Leave a comment

Find vSphere VM locations: Folder, vApp and Resource Pool

The vSphere client doesn’t seem to give you a nice overview where you can see all the location data about your virtual machines. You can see the Folder and vApp by expanding all the branches in the VMs & Templates view, … Continue reading

Rate this:

Posted in PowerShell, Scripting, vSphere | Tagged , , , , , , , , , , , , , , | Leave a comment

Search for VMware RDMs

A storage admin recently asked me if a couple of LUNs were still in use. They had very little info about them, but knew they were presented to the vSphere hosts. So I wrote a quick script to find all … Continue reading

Rate this:

Posted in PowerShell, Scripting, vSphere | Tagged , , , , , , , , , , | Leave a comment

VMware E1000e vmnic Windows Server 2012 data corruption

Found this yesterday: http://kb.vmware.com/kb/2058692 “On a Windows 2012 virtual machine using the default e1000e network adapter and running on an ESXi 5.0 or 5.1 host, you experience these symptoms:  Data corruption may occur when copying data over the network.  Data … Continue reading

Rate this:

Posted in PowerShell, vSphere | Tagged , , , , , , , , , , , , | Leave a comment

Get VMware VM creation date (kind of)

VMware vSphere doesn’t seem to keep the VM creation date in its database anywhere, but if your VMs are all/mostly running Windows (and you have permission to do a WMI query against them) you can get the OS install date, … Continue reading

Rate this:

Posted in PowerShell, vSphere, Windows | Tagged , , , , , , , , , | 10 Comments