For anyone who uses Quest’s vRanger or vReplicator, you’ll most likely be aware of the lack of multi-select options available for job management. I was becoming increasingly frustrated until I remember how much Quest like to tie in Powershell to their products. So, after some mucking around with their commandlets, I came up with a way to initiate a failover test and once completed, restore everything back. Read the rest of this entry »

Quite often I want to have a few lines of Powershell at say 6pm. Rather than setting up a scheduled job, either via Windows or the Powershell scheduler, I setup this quick little code block. Just enter in a 24hr time and it will work out how many seconds until that time and put in a sleep. This might not be the neatest way of doing things, but it’s quick an easy! Read the rest of this entry »

Make annoying beeps at random

Posted: April 26, 2012 in Scripts

The script below is designed to just really annoy the hell out of someone or scare the crap out of them as they wander around the server room looking for the offending equipment. Generates a random number of beeps (1-10 in this case), at a random interval between 20 and 100 secs. Imagine a room full of servers doing this! Read the rest of this entry »

Every now and then, you have cause to want to max a machine or bunch of machines CPU. For example, to test out DRS in a VM farm. Here’s a simple Powershell code block to get the job done.

# Adjust the first for loop to reflect the number of available cores in the machine or twice as many if you want to be sure
ForEach ($Number in 1..4){

start-job -ScriptBlock{
$result = 1; foreach ($number in 1..2147483647) {$result = $result * $number}
}

}

Wait-Job *
Clear
Receive-Job *
Remove-job *

Howdy all,

For those who haven’t heard, Microsoft have released a critical update to patch a vulnerability with RDP. Get your machines patched ASAP for this one!

http://technet.microsoft.com/en-us/security/bulletin/ms12-020

Ever had one of those really odd issues where the prod and test server are supposed to be identical, but a process works on one and not the other? I had that recently and I was sure it was related to a service pack or application upgrade that had taken place. I ran this Powershell script across the 2 servers to find any DLLs in the System32 directory that were different. Turned out to be the MSJET35.dll. Read the rest of this entry »

I recently did a VM migration from ESX 3.0.3 to ESXi 5. As part of the migration, we were upgrading tools and VM hardware. This in a lot of cases will cause the gest to lose it’s network configs. With that in mind, I created the following quick PowerSheel script to go out and retrieve the target VMs network configs and save them to text files, so that we could go back and reset them if needed. Read the rest of this entry »