PowerCLI to get Virtual to Physical CPU Ratio

PowerCLI to get Virtual to Physical CPU Ratio

I was in a meeting today, and was asked, “What is the current virtual to physical CPU ratio?”  I didn’t have an answer for this question, so I asked PowerCLI for the answer.

[PS]
(get-cluster $ClusterName | Get-vm | Where Powerstate -eq “PoweredOn” | Measure NumCpu -sum).sum / (((Get-cluster $ClusterName | Get-vmhost).extensiondata.summary.hardware | Measure -Property numCpuCores -Sum).sum)
[/PS]

This will be a handy script that can be ran rather quickly. … Continue reading

PowerShell to Install Windows IIS Features

To XML install or not to XML install

For as long as I know, I have used PowerShell to install Internet Information System (IIS).  The method of which I use PowerShell to install the features have changed, but its still PowerShell.

Originally I was given an XML file that was generated, and I would use that to install the features, but once my scripting skills advanced I learned that there were other ways to do it. … Continue reading

PowerCLI to Update VMHost Name

What’s your (host)name?

While digging through Log Insight on a problem, I found a new one.  A large majority of VMhosts were not configured with a proper hostname.  This was also backup by the vCheck report that gets generated weekly.  The hosts were configured with ‘localhost’ as the hostname, which makes this a huge pain when trying to follow the logs.… Continue reading