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

Get-FMG also not working #11

Open
palakd38 opened this issue Sep 18, 2024 · 8 comments
Open

Get-FMG also not working #11

palakd38 opened this issue Sep 18, 2024 · 8 comments

Comments

@palakd38
Copy link

I am getting connected to the specific adom. But when I am trying to fetch all the FirewalAddress is also not working, getting the following:

PS C:\WINDOWS\system32> Get-FMGFirewallAddress -connection $fmgConnect | Format-Table
Unable to use FortiManager API (-6) Invalid url
At C:\Program Files\WindowsPowerShell\Modules\PowerFMG\0.1.0\Private\RestMethod.ps1:184 char:13

  •         throw "Unable to use FortiManager API (" + $response.resu ...
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : OperationStopped: (Unable to use F...-6) Invalid url:String) [], RuntimeException
    • FullyQualifiedErrorId : Unable to use FortiManager API (-6) Invalid url
@alagoutte
Copy link
Contributor

alagoutte commented Sep 18, 2024

What do you have with -verbose ?

What also FMG release ?

@palakd38
Copy link
Author

Getting the same with verbose as well:
PS C:\WINDOWS\system32> Get-FMGFirewallAddress | Format-Table -verbose
Unable to use FortiManager API (-6) Invalid url
At C:\Program Files\WindowsPowerShell\Modules\PowerFMG\0.1.0\Private\RestMethod.ps1:184 char:13

  •         throw "Unable to use FortiManager API (" + $response.resu ...
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : OperationStopped: (Unable to use F...-6) Invalid url:String) [], RuntimeException
    • FullyQualifiedErrorId : Unable to use FortiManager API (-6) Invalid url

@palakd38
Copy link
Author

With the release if you mean version:

Platform Full Name : FortiManager-VM64
Platform Type : FMG-VM64
Release Version Information : (GA)
Serial Number : FMG-VMTM20003464
TZ : Europe/Amsterdam
Time Zone : (GMT+1:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna.
Version : v7.4.3-build2487 240514 (GA)

@alagoutte
Copy link
Contributor

What powershell release ? (Do you have try with PS 7 ?)

What do you use cmdlet for connect-FMG ?

i can’t try for the moment but I will try next week

@palakd38
Copy link
Author

palakd38 commented Sep 18, 2024

Actually it is working nowhere. I tried in powershell 5 and PS7, nowhere it worked.

I for cmdlet powershell and the same tried in vscode also, nowhere worked.

Was working till monday actually.

@alagoutte
Copy link
Contributor

-verbose need to be set for get-FMGFirewallAdress ( and not Format-Table)

@palakd38
Copy link
Author

palakd38 commented Sep 18, 2024

With verbose:

PS C:\Users\z004m7hu> Get-FMGFirewallAddress -verbose
VERBOSE: {
"params": [
{
"url": "pm/config/adom/wurmloch/obj/firewall/address"
}
],
"verbose": 1,
"session": "HFDAMLWLMabp+538kBWdFAEIsNjG5Kc+QFaEFqLl4YBbUr4mWf/F+bvgyvvsGx9hsaFCHCvJ1uKFxqiKdnh9jA==",
"method": "get",
"id": 4
}
VERBOSE: Requested HTTP/1.1 POST with 202-byte payload
VERBOSE: Received HTTP/1.1 response of content type application/json of unknown size
VERBOSE: Content encoding: utf-8
Exception: C:\Users\z004m7hu\Documents\PowerShell\Modules\PowerFMG\0.1.0\Private\RestMethod.ps1:184
Line |
184 | throw "Unable to use FortiManager API (" + $response.resu …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Unable to use FortiManager API (-6) Invalid url

@alagoutte
Copy link
Contributor

Do you have always the issue ?
do you have check the name of ADOM ?

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

2 participants