Importing UCS VLANs

I’ve had to deal with two UCS systems recently, ensuring that the configuration matches on them both, most of which I was happy to go through by hand. But the long list of VLANs was another story. I could see that they can be exported, but I couldn’t find an import ability. So, a quick search later, I found this webpage: but is very nearly what I’m after, but we need to make a little modification. This is because the VLANs are exported in the following format:


So we must adjust the powershell to take account of the format of the Name field (where the name always comes after the first “-“). This is what it looks like:

This does print out the details of each VLAN once it has been added. Adding a “| out-null” at the end of the line in the foreach loop should fix that if you want it to be nice and tidy.