Hi,
I'm trying to run a script:
execute factoryreset
y
to do a factory reset from a Fortimanager script, but not sure how to pipe "y" to the question when it get prompt:
execute factoryreset
echo y
FWF60E # execute factoryreset
This operation will reset the system to factory default!
Do you want to continue? (y/n) <<<<<< what to add in script to execute
FWF60E # execute echo y
command parse error before 'echo'
Command fail. Return code -61
FWF60E #
Any info would be helpful oi
Just enter y in a new line.
So the script would be:
execute factoryreset
y
I just tested and confirmed it works on FMG 6.4.7.
This is the original script which is exactly like yours, but I have a lab setup behind a local spectrum router. At the spectrum router, I have portforwarding setup for https port 443 and http port 80, should I open another port? From the fortiwifi, Security Fabric>Settings>Use Fortimanager was on and after I ran it the 1 time, from Fortimanger said wan1 was down, but I can get to Fortiwifi it could no longer to the Test Connectivity test. What other ports should I put my spectrum router/modem to keep the communication up when executing the factoryreset from Fortimanager?
If it makes any difference, my 60E is setup to use dhcp.
You also need TCP/541 at least, that's the port FortiManager/FortiGate use for the management tunnel.
You can find a list of complete ports and protocols here:
https://docs.fortinet.com/document/fortigate/6.4.0/ports-and-protocols/303168
-> there is a FortiGate and a FortiManager section
Select Forum Responses to become Knowledge Articles!
Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.
User | Count |
---|---|
1741 | |
1109 | |
755 | |
447 | |
240 |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.