Made progress on my script for auto logging into multiple cisco switches, have some more questions.

So here is my script so far…

70..80 | % { plink “172.16.15.$_” -l username -pw password}

This allows me to automatically log into each switch in whatever range I type in at the beginning and automatically rolls to the next one when I hit type the exit command on the cisco switch.

So I am looking to take this a step farther. I want to automate any config changes to our switches by adding them to this script.

So say I want to create a new user on the switch. It would look something like…

en

conf t

username b.smith privilege 15 secret 5 3*#854jsk3958(%trj.

wr mem

exit

can I just add that to the PS script, or should I write it up in a text file and some how point PS to that text file to apply to the switch?

submitted by /u/hhhax7
[link] [comments]

Leave a Reply