PowerShell to Get OS Type and Count

My manager asked for the count of Windows Server 2012 virtual servers. So I did a fast and dirty script to get just the count of Server 2012

$server2012 = ((get-vm).extensiondata.guest | Where GuestFullName -eq "Microsoft Windows Server 2012 (64-bit)").count

After I provided the results from this, I worked to make it a better, more robust script.… Continue reading

PowerShell to Rename Datastores

At work we recently had a health check performed on our virtual environment. When the results came back, and I noticed a trend with our legacy VM hosts. Particularly where we didn’t follow the same standards as we did on the newer hosts. The issue I’ll be talking about, is renaming the local datastores. So now is the time to apply the same standards across the entire environment.… Continue reading

PowerShell and Plink to Update Avamar Proxy Timeout Settings

When colleagues in the office have a repeatable process that can and should be scripted, I’m the person they seek out. This particular time it was a storage admin looking to see what could be done with verifying a setting in a file on a Linux appliance and changing the setting if it is not set to the preferred value.… Continue reading

PowerShell to Remove Users from Cross Domain Groups

How would you remove over 1,000 users from 10 different AD groups?” Another engineer on my team asked me this, and my answer without a beat, PowerShell.

The work environment has many different domains and several forests. So this shouldn’t be a difficult process. So I started with the simple approach, of getting the Users.txt… Continue reading

When Get-ContentLibraryItem Fails

In my work environment we have made strives to simply our VMware environment. One of them is using the content library for templates and ISO files. We do this so we make sure the everyone is using the most current golden image. Also with the content library you can sync them from primary site to secondary site without issues.… Continue reading

Automate Removal of VM Snapshots

Automate Removal of VM Snapshots

When I come up with an idea for a blog post, normally I don’t review what ideas I have already wrote about.  I should because I would have noticed another post about snapshots I wrote earlier this year.  This post is different as it has more cowbell, err automation.  Everybody loves automation right? … Continue reading

PowerCLI to list Template Info

We are starting to decommission the legacy VMware hosts in my work environment. Normally not a big deal or script for a task like this, but give me enough time I found a need. Templates. So you can easily find templates either using the H5 client or PowerCLI.

VM templates
Get-Template

This cmdlet displays a list of the template VMs that are in the environment, but it doesn’t say where they are located.… Continue reading

PowerShell and Math Homework

My 10 year daughter asked me to check her math homework tonight. Math was my best subject in school, but that was a long time ago. The assignment that she had was to find if several of numbers where divisible by 2, 3, 4, and 5. I started to look at it this and said that I could write a computer script to check the answers.… Continue reading

My 10 year daughter asked me to check her math homework tonight. Math was my best subject in school, but that was a long time ago. The assignment that she had was to find if several of numbers where divisible by 2, 3, 4, and 5. I started to look at it this and said that I could write a computer script to check the answers.… Continue reading

How to add a VM to Content Library using PowerCLI

This task sounds very simple.  Target the VM, then import to the primary content library for replication to the subordinate libraries.  This task can be accomplished right now with a few clicks in the GUI.  I’m not a GUI kind of person, I like the mash the keys to get stuff done.  So after a lot of research, I found that the PowerCLI commands to perform this function just don’t exist at this point.… Continue reading

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