- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Powershell Script to Backup Fortigates Cofiguration
Hello , Im looking for a powershell script to backup the configuration of all my fortigates .i have fortigate 60D and 300D . any help please ?
FI : We dont have Fortimanager :) Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi ,
Kindly follow the following method,
http://kb.fortinet.com/kb/documentLink.do?externalID=FD39818
Regds,
Ashik , NSE8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks .But i prefer use a powershell script to connect to SSH and then launch backup command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For some alternatives, using either pscp.exe from Putty or DLLs, see here:
https://stackoverflow.com...rnative-for-powershell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
https://forum.fortinet.com/tm.aspx?m=116738
--------------------------------------------
If all else fails, use the force !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
With linux I did it like this:
#! /usr/bin/expect -f set timeout 8000 set date [clock format [clock seconds] -format {%Y%m%d}] spawn ssh <forti user>@<forti ip> expect "password: " send "<forti password>" expect "$ " send "execute backup full-config ftp $date-backup <ftp server ip> <ftp server user> <ftp server user password> expect "$ " send "exit\r"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hm looks a bit the long way :) It will of course do the trick. But maybe you need less code if you just scp your config instead of doing ssh to the FGT and then exec a backup and upload it to a ftp server?
Here is a KB Article that describes how to do that via scp: http://kb.fortinet.com/kb/viewContent.do?externalId=12002
Also there is an older Thread to be found in fortinet forums which is about this: https://forum.fortinet.com/tm.aspx?m=114055
To do scp in powershell you might aswell use freeware like putty's pscp or similar if you don't want/have ps plugins for it. This would then not even require powershell but just a cmd :)
--
"It is a mistake to think you can solve any major problems just with potatoes." - Douglas Adams
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Elthon Abreu FCNSA v5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Elthon Abreu ,
it would be greatful from you .
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Azuriste wrote:Hello Elthon Abreu ,
it would be greatful from you .
Thanks
Look at [link]https://forum.fortinet.com/tm.aspx?m=157597#158374[/link]
Elthon Abreu FCNSA v5