Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reg Connect-FGT #195

Closed
sureshwin006 opened this issue Oct 18, 2022 · 4 comments
Closed

Reg Connect-FGT #195

sureshwin006 opened this issue Oct 18, 2022 · 4 comments

Comments

@sureshwin006
Copy link

sureshwin006 commented Oct 18, 2022

Hi Team I would like to know does the script supports importing CSV files and looping it through each management IP address in CSV file.

I got the below error when I import it however it works fine when looping it through this way

$unique_device_ips = "172.16.10.10", "172.16.10.11"
Foreach($unique_device_ip in $unique_device_ips) { 
Connect-FGT -Server $unique_device_ip -Credentials $psCred -SkipCertificateCheck
}

Unable to connect to FortiGate
At C:\Program Files\WindowsPowerShell\Modules\PowerFGT\0.6.1\Public\Connection.ps1:181 char:17
+                 throw "Unable to connect to FortiGate"
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : OperationStopped: (Unable to connect to FortiGate:String) [], RuntimeException
+ FullyQualifiedErrorId : Unable to connect to FortiGate

Also, I would like to know if is there a way to get export CSV every result from the below modules in one short

Get-FGTMonitorSystemFirmware
Get-FGTSystemGlobal 
Get-FGTMonitorSystemHAPeer
Get-FGTSystemInterface

Thanks for the quick reply.

@alagoutte
Copy link
Contributor

Hi,

the foreach loop work for me... can you add -verbose ? (all device have the same login/password ?)

you can export using Export-CSV (or using Export-Excel from ImportExcel Module) but need to write your code to get an unique file

@alagoutte
Copy link
Contributor

@sureshwin006 it is good ? i can close ?

@RamakantRThorat
Copy link

I need some help regarding the same issue, I am connecting the firewall with the IP address

image
I have also used -skipCertificateCheck -httpOnly

image

@RamakantRThorat
Copy link

Please ignore my comment
I am able to connect by specifying -port parameter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants