Thursday, May 10, 2018

Batch multiple "show" commands (Cisco)

Hello r/Networking!

Trying to figure out how to batch or PowerShell multiple "show" commands in Cisco 3750 & 4500 switches.

I've tried using this in PS:

$password = "password" $switchip = "ip-goes-here" C:\Users\username\putty.exe -2 username@$switchip -pw $password -m "C:\Users\username\commands.txt" 

With the following being in commands.txt:

show config show vlan show logging 

But it just closes the connection after the "show config".

I've also tried copying the pasting all the commands at once in separate lines, but that doesn't work either. Finally, I've tried putting a semicolon between each command (I.E. "show config;show vlan;show logging"), but it doesn't work like that either.

My tools are pretty much limited to PowerShell and PuTTY (I cannot install additional software).

Any advice would be greatly appreciated.



No comments:

Post a Comment