Archive for the ‘code’ Category

Inverse ARP

While researching fast ways to find a relationship between a MAC and IP address, I dug up some info on Inverse ARP and found out that it isn’t widely a supported protocol. Basically, it’s only used in frame relay networks, which doesn’t help matters.
So I did what any sensible geek does, I hacked something together.
This [...]

Of IPs & Subnets

While if you look, there are tools to calculate a IP subnet/address range, they all seem to rely on string splitting and converting the address to binary manually. Which I think is bulky, hard to maintain, and more importantly, not that elegant. So pulling to mind my Cisco CCNA classes where my instructor would drill [...]

Restoring Hyper-V VM with snapshot tree

For whatever reason, you’ve lost your virtual machine settings in Hyper-V and it just so happened they are snapshots. I sure hope that this was a test server and not a production one! Tsktsk! By now, you’ve probably scoured the interweb searching for a cure, and you’re in luck, you’ve found a way to get [...]

My first cmdlet, Out-Web

It’s been a while since I’ve done a for fun computer project, so I decided I wanted to learn how to make PowerShell Cmdlets. The problem was that I couldn’t think of really anything I wanted to make! Then one day I was reading Lee Holmes’ blog, saw the “Out-Web” and had a project.
Download the [...]

Cracking the Windows Update API

Something that I’ve been working on for a while is an application or script that checks the availability of other servers to decide if it should start the update/restart steps. Though testing and more testing, I’ve found that even with the awesome power of Powershell, I still needed the power of a binary to get [...]

Fixed: fastping, now with working get-help comments

After getting frustrated with my fastping not displaying anything after using get-help, I asked the twitterverse for help, and they did! Super-duper thanks to @djryan (twitter/web) for the pointers.

<#
.SYNOPSIS
Ping a node as fast as you can.
.DESCRIPTION
Whereas the ping.exe utility keeps steady at 1 ping per second,
this will ping with custom wait periods as low as [...]

Ping faster from powershell with FastPing!

I’ll let the code do most of the talking.
<#
.Synopsis
Ping a node as fast as you can.
.Description
Whereas the ping.exe utility keeps steady at 1 ping per second,
this will ping with custom wait periods as low as 0 milliseconds.
.Parameter ip
IP or hostname of network node.
.Parameter count
Number of pings to [...]

Finding applicable Windows Updates via cli

An ongoing project here at work is server maintenance and applying patches. One of the issue we’ve been facing is how to do windows updates for clusters. While we could do an AD structure and schedule different install and restart times for the different sides, we can’t include checks to see if the other side [...]

MS-SQL Powershell database backup

Recently one of our SQL clusters decided it was a good idea to not backup databases anymore. So today my boss told me to get something to bandaid the situation until we can fix the situation (which will likely be an upgrade/reinstall).
To learn more check out the MSDN pages on the Microsoft.SqlServer.Management.Smo namespace.

#
# Temp database backup
#
$d [...]

Windows 7 Powershell LogonUI Changer

Based off of the W7C LogonUI Changer, this Powershell script should make changing the LogonUI background easier for the IT admins out there.
Download win7logonui.zip (Includes the ImageProcessor source and DLL)
Usage:

After copying or building imageprocessor.dll move it to the same folder as win7logonui.ps1 (or edit the script).
Example: win7logonui.ps1 \path\to\image.jpg
Set $DebugPreference to “Continue” to watch the script [...]