Generating VM Tags with PowerCLI

Generating VM Tags with PowerCLI

With the our new infrastructure upgrade it also included an upgrade to our backup solution.  So we now have EMC Avamar for backups, and with this it means a chance to architect the backup solution the best possible way.  So during the initial stage, I worked closely with our storage team to get the method that they chose to work. … Continue reading

PowerCLI to Generate Nested VM Folder Structure

PowerCLI to Generate Nested VM Folder Structure

We are currently starting to plan for a disaster  recovery test, and the first part is configuring Site Recovery Manager (SRM).  We are still in the middle of the infrastructure replacement, so we are starting from scratch with everything.  So for SRM to work the best we need to have identical folder structures in both locations.… Continue reading

Cisco UCS PowerTools and PowerShell

Cisco UCS PowerTools and PowerShell

As I mentioned in a previous post, we are upgrading our infrastructure and we are using Dell EMC VxBlock.  So far this upgrade is going fairly smooth, but we are still at the very beginning of the process.  So once I found out that the VxBlock was configured to contain UCS hardware, I began looking to see what Cisco had to offer for PowerShell modules to help manage the new hardware that we are getting. … Continue reading

PowerShell to Find Users in Multiple AD Groups

PowerShell to Find Users in Multiple AD Groups

Another of the engineer that I would with came to me with a scripting issue.  They had a list of 185 users account that he needed to find if they were members of a list of 6 AD groups.  So that is where PowerShell and I come into this issue. … Continue reading

Change PS Prompt Based on vCenter Connection

The Prompt of a Different Color

In my work environment we are undertaking a major infrastructure upgrade.  We are doing a total refresh of all of the virtual environment, and with this we are also setting up a new vCenter.  With this it can get confusing with having multiple PowerShell ISE apps open and which vCenter I’m currently connected. … Continue reading

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

Gather IP information from Multiple Servers

Gateway to PowerShell Scripting

One of the admins on my team asked the question to me, “How would I get the gateway information from a list of servers?”

I stopped to ponder this issue, and immediately said, “WMI queries is the way I would do this.”

The Thought Process to Select WMI

In my environment PowerShell remoting isn’t configured everywhere, so it wouldn’t be a good option.… Continue reading

Removing Snapshots with PowerCLI

Snapshots for Maintenance or Maintenance for Snapshots…

During our last maintenance window for our VMware environment, my team updated VMware Tools, hardware and aligned vNUMA.  So before we started this work we took snapshots of all of the VMs there were getting the updates.  Fast forward a few days, and now we have 600+ snapshots that need to be deleted.… Continue reading