In this article I will briefly explain about how to backup running configuration of your Dell switches to a TFTP server location using PowerShell.
Prerequisites:
- A TFTP server should be configured and running
Workflow:
- Get a list of IP address of switches that needs to be backed uplist = Get-Content .\switch_list.txt
- Collect credentials to SSH into the switch$creds = Get-Credential
- Create a new SSH session to the first switch in the list$sw_ssh = New-SshSession -ComputerName 192.168.10.2 -Credential $creds -Force -ConnectionTimeout 300
- Invoke the command to backup running config to TFTP server over the SSH session$filename =(Get-Date).tostring("dd-MM-yyyy-hh-mm-ss")$cmd_backup = "copy running-config tftp://192.168.11.33/sw01/$filename.txt"Invoke-sshcommand -Command $cmd_backup -SSHSession $sw_ssh
- Repeat step 3 and 4 for all the switches in the list
Project reference:
Note:
You can schedule this PS script using a task scheduler, so that the running configuration of switches can be backed up automatically on a daily basis or as per requirements.
Hope this was useful. Cheers!
Thanks for writing such a good article, I stumbled onto your blog and read a few post. I like your style of writing. touch switches surat
ReplyDelete