Isn’t weird how we make such an effort to automate parts of our job but still do other repetitive things manually? In my environment, I automate every AD task I can. Yet, I find myself manually configuring and updating network devices.
So I made an effort to update the firmware for all of our switches automatically. We have around 150 managed switches. When this was done manually, it would take around 4 minutes a switch. For my whole network, it would take at least 10 hours of work. It now takes about 30 seconds.
In this guide, we are going to use PowerShell to deploy and update switch firmware. The examples below will be specific to HP ProCurve switches. However, each section should be easily adaptable to any make or model by substituting the commands used for your specific switch.
Three First Steps Toward Network Automation
The first thing you need to have is a network inventory. Specifically, you will need a CSV containing the name, IPAddress, and model of each device that you want to manage. Those three values (Name, IPAddress, Model) should be the headers for your CSV.
Because switches rarely change location and are not frequently replaced, you shouldn’t have to update this CSV often. To create it, you can use something like the Cisco Discovery Protocol to walk through your network, use a network inventory application, or an export for an existing asset inventory.
The second thing you’ll need is a local copy of both PuTTY and KiTTY. KiTTY supports more command line options than PuTTY. Examples include stringing commands together, waiting, running in tray, and sending input to multiple sessions at once. You can download KiTTY from here. Save KiTTY and your network inventory CSV into the same folder. I saved mine in C:\Putty\
The final thing you will need is a TFTP server. You can simply install a TFTP server application on an existing Windows box to meet this requirement. Personally, I use the free SolarWinds TFTP server application. When you install your TFTP server application, you will select a folder that client can connect to (ex: C:\TFTP\). Inside this folder, create a subfolder named Updates.