Category: PowerShell
PowerShell Script To Get vMotion Events
- Ben Liebowitz
- 0
- 2629
Recently, I had the need to get a list of vMotion events to pass to management. I attempted to use the Get-VIEvent cmdlet for this, but found it wasn’t easy to only pull logs from one specific cluster. I attempted to use the -Entity option and direct it to the cluster I wanted, but that didn’t work well. So I…
Create an ISO file with PowerShell!
- Ben Liebowitz
- 32
- 35554
I received a request at work to transfer 5+gb from the internal network, to a server in the DMZ. Our DMZ networks are locked down, so I cannot copy the files directly. I have the trial version of UltraISO that I’ve used for tasks like this in the past, but it’s limited to 300mb in the trial version. Previously, we’ve…
Handy PowerShell command to stop Task Manager Process!
- Ben Liebowitz
- 0
- 1179
Have you ever needed to stop multiple processes at once? I use a product by Devolutions called Remote Desktop Manager. If you’re a regular reader of this blog, you probably already know that. When I launch the VMware vCenter Web Client via RDM, I do so via Chrome and it opens the Client Integrated Plugin. The problem is, when I…
Script to disable protocols older than TLS 1.2 and turn off RDP
- Ben Liebowitz
- 0
- 1740
My InfoSec team came to us asking we disable anything older than TLS 1.2 and turn off RDP on our servers in the DMZ. We don’t allow RDP in the DMZ anyway, and they found that leaving RDP on when not using it poses a security risk. To do this, it involved multiple registry changes. With several servers to do…
PowerCLI Script to Check Host Over-commitment Percentage & Ratios
- Ben Liebowitz
- 5
- 2793
At my previous employer, we had a Dev/QA vSphere environment that was very over provisioned. The environment had lots of CPUReady issues with VMs having to wait for CPU time, which caused things to be slow, etc. We knew this but the application teams didn’t understand. I ended up writing a PowerCLI script to check the CPU overcommitment and sent…
Script to backup your vCenter DRS Rules
- Ben Liebowitz
- 8
- 2780
I was thinking yesterday, I have a script that I run on a monthly basis to backup my vDS configs… Shouldn’t I also have something that does the same for my DRS rules? So, I wrote a script that I can schedule to run on a weekly/monthly basis to backup my DRS rules. I have multiple vCenter servers, so I…
PowerCLI Script to create new vDS Portgroups
- Ben Liebowitz
- 0
- 4098
We deployed new hosts into one of our office locations. Because these hosts would have different number of uplinks as well as use a LAG group instead of normal dvUplinks, we decided to create a new vDS Switch. Then, we needed to re-create all the portgroups as well. I figured, instead of manually adding 15-20 portgroups, I’ll automate it. I…
Creating shortcuts for PowerCLI that automatically log you in.
- Ben Liebowitz
- 5
- 3046
So, I started a new job a couple of months ago and we have multiple vCenter environments. My friend & temporary co-worker, Brian Spagna (@bspagna) and I both wanted to have shortcuts to launch PowerCLI windows and have a different background color for each to easily identify which environment we were in. We thought it would be cool to have…
Script to delete folder older than 30 days… by Name
- Ben Liebowitz
- 0
- 2672
I had a need, on one of my file servers, to delete some data that was older than 30 days, to clear space. This would need to be a re-occurring task, so what better way to accomplish it than to script it! Here’s the rub… The folders are each in a YYYYMMDD format (ex: 20170115), yet the content in the…