Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
Azuriste
New Contributor

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,

9 REPLIES 9
Ashik_Sheik
Contributor II

Hi ,

 

Kindly follow the following method,

 

http://kb.fortinet.com/kb/documentLink.do?externalID=FD39818 

 

Regds,

 

Ashik , NSE8

Sheik Mahammad Ashik
Sheik Mahammad Ashik
Azuriste

Thanks .But i prefer use a powershell script  to connect to SSH and then launch backup command 

ede_pfau

For some alternatives, using either pscp.exe from Putty or DLLs, see here:

https://stackoverflow.com...rnative-for-powershell

Ede Kernel panic: Aiee, killing interrupt handler!
Ede Kernel panic: Aiee, killing interrupt handler!
Alexis_G
Contributor II

https://forum.fortinet.com/tm.aspx?m=116738

 

--------------------------------------------

If all else fails, use the force !

-------------------------------------------- If all else fails, use the force !
Ricardo_Tomas

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"

 

sw2090

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

-- "It is a mistake to think you can solve any major problems just with potatoes." - Douglas Adams
Elthon_Abreu
Contributor

Hi, I'm have batch and bash scripts for backup tasks of my Fortigates. I can share them if you like. Best regards.

Elthon Abreu FCNSA v5

Elthon Abreu FCNSA v5
Azuriste

Hello Elthon Abreu ,

 

it would be greatful from you .

 

Thanks

Elthon_Abreu

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

Elthon Abreu FCNSA v5
Announcements

Select Forum Responses to become Knowledge Articles!

Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.

Labels
Top Kudoed Authors