### Get User Fortitoken Information Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTMonitorUserFortitoken.md Use this cmdlet to retrieve information about user FortiTokens. No specific setup is required beyond having the PowerFGT module installed and a connection established. ```powershell Get-FGTMonitorUserFortitoken ``` -------------------------------- ### Example Usage of Confirm-FGTAddressGroup Source: https://github.com/fortipower/powerfgt/blob/master/docs/Confirm-FGTAddressGroup.md This example demonstrates how to use the Confirm-FGTAddressGroup cmdlet. Replace '{{ Add example code here }}' with actual cmdlet parameters and values. ```powershell PS C:\> {{ Add example code here }} ``` -------------------------------- ### Invoke-FGTRestMethod - GET Request with Default Method Source: https://github.com/fortipower/powerfgt/blob/master/docs/Invoke-FGTRestMethod.md This example shows how to perform a GET request to a URI when the method parameter is omitted, as 'get' is the default method. ```powershell Invoke-FGTRestMethod "api/v2/cmdb/firewall/address" ``` -------------------------------- ### Get All System Interfaces Source: https://context7.com/fortipower/powerfgt/llms.txt Retrieves and displays all system interfaces on the FortiGate in a table format. ```powershell Get-FGTSystemInterface | Format-Table ``` -------------------------------- ### Get SD-WAN Settings Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTSystemSDWAN.md Retrieves all SD-WAN settings. This is the basic usage of the cmdlet. ```powershell Get-FGTSystemSDWAN ``` -------------------------------- ### Create Local User with LDAP Authentication Source: https://context7.com/fortipower/powerfgt/llms.txt Demonstrates creating a local user account that authenticates against a pre-configured LDAP server. ```powershell # Create user using LDAP authentication Add-FGTUserLocal -Name "LDAPUser" -ldap_server "MyLDAP" ``` -------------------------------- ### Get Log Traffic from FortiCloud Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTLogTraffic.md Retrieves traffic logs from FortiCloud with the subtype set to 'local'. This is a basic example to start fetching logs. ```powershell Get-FGTLogTraffic -type forticloud -subtype local ``` -------------------------------- ### Get Fortinet License Status Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTMonitorLicenseStatus.md Retrieves the status, version, and last update time for Fortinet licenses. No specific setup or imports are required beyond having the PowerFGT module installed. ```powershell Get-FGTMonitorLicenseStatus ``` -------------------------------- ### Configure SDN Connector with Data Hashtable Source: https://github.com/fortipower/powerfgt/blob/master/docs/Set-FGTSystemSDNConnector.md This example demonstrates how to configure a specific setting, like 'ha-status', on an SDN Connector using a hashtable passed to the -data parameter. The SDN Connector must exist. ```powershell $data = @{ "ha-status" = "enable" } PS C:\>Get-FGTSystemSDNConnector -name PowerFGT | Set-FGTSystemSDNConnector -data $data ``` -------------------------------- ### Get HA Checksum Monitor Information Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTMonitorSystemHAChecksum.md Use this cmdlet to retrieve HA checksum monitor information, including checksums for global, root, and all configurations. No specific setup is required beyond having the PowerFGT module installed and a connection established. ```powershell Get-FGTMonitorSystemHAChecksum ``` -------------------------------- ### Deploy FortiGate VM Source: https://github.com/fortipower/powerfgt/blob/master/docs/Deploy-FGTVm.md This snippet demonstrates how to deploy a FortiGate VM by providing a hashtable of build parameters to the Deploy-FGTVm cmdlet. ```APIDOC ## Deploy-FGTVm ### Description Deploys a FortiGate VM by passing an array of settings. ### Method POST (Conceptual - This is a PowerShell cmdlet, not a REST API) ### Endpoint N/A ### Parameters #### Request Body (Conceptual - PowerShell Parameters) - **ovf_path** (String) - Required - Path to the OVF file for the FortiGate VM. - **vm_host** (String) - Required - The target host for the VM. - **datastore** (String) - Required - The datastore to use for the VM. - **Cluster** (String) - Required - The cluster where the VM will be deployed. - **inventory** (String) - Optional - The inventory name for the VM. - **name_vm** (String) - Required - The name of the virtual machine. - **hostname** (String) - Required - The hostname for the FortiGate VM. - **dns_primary** (String) - Required - The primary DNS server address. - **dns_secondary** (String) - Optional - The secondary DNS server address. - **int0_network_mode** (String) - Required - Network mode for interface 0 (e.g., "Static"). - **int0_gateway** (String) - Required - Gateway for interface 0. - **int0_ip** (String) - Required - IP address for interface 0. - **int0_netmask** (String) - Required - Netmask for interface 0. - **int0_port_group** (String) - Required - Port group for interface 0. - **net_adapter** (String) - Optional - Network adapter type (e.g., "vmxnet3"). - **int1_network_mode** (String) - Required - Network mode for interface 1. - **int1_ip** (String) - Required - IP address for interface 1. - **int1_netmask** (String) - Required - Netmask for interface 1. - **int1_port_group** (String) - Required - Port group for interface 1. - **int2_network_mode** (String) - Required - Network mode for interface 2. - **int2_ip** (String) - Required - IP address for interface 2. - **int2_netmask** (String) - Required - Netmask for interface 2. - **int2_port_group** (String) - Required - Port group for interface 2. - **int3_network_mode** (String) - Required - Network mode for interface 3. - **int3_ip** (String) - Required - IP address for interface 3. - **int3_netmask** (String) - Required - Netmask for interface 3. - **int3_port_group** (String) - Required - Port group for interface 3. - **int4_network_mode** (String) - Required - Network mode for interface 4. - **int4_ip** (String) - Required - IP address for interface 4. - **int4_netmask** (String) - Required - Netmask for interface 4. - **int4_port_group** (String) - Required - Port group for interface 4. - **int5_network_mode** (String) - Required - Network mode for interface 5. - **int5_ip** (String) - Required - IP address for interface 5. - **int5_netmask** (String) - Required - Netmask for interface 5. - **int5_port_group** (String) - Required - Port group for interface 5. - **int6_network_mode** (String) - Required - Network mode for interface 6. - **int6_ip** (String) - Required - IP address for interface 6. - **int6_netmask** (String) - Required - Netmask for interface 6. - **int6_port_group** (String) - Required - Port group for interface 6. - **int7_network_mode** (String) - Required - Network mode for interface 7. - **int7_ip** (String) - Required - IP address for interface 7. - **int7_netmask** (String) - Required - Netmask for interface 7. - **int7_port_group** (String) - Required - Port group for interface 7. - **int8_network_mode** (String) - Required - Network mode for interface 8. - **int8_ip** (String) - Required - IP address for interface 8. - **int8_netmask** (String) - Required - Netmask for interface 8. - **int8_port_group** (String) - Required - Port group for interface 8. - **int9_network_mode** (String) - Required - Network mode for interface 9. - **int9_ip** (String) - Required - IP address for interface 9. - **int9_netmask** (String) - Required - Netmask for interface 9. - **int9_port_group** (String) - Required - Port group for interface 9. - **capacityGB** (Int32) - Optional - Disk capacity in GB. - **memoryGB** (Int32) - Optional - Memory in GB. - **cpu** (Int32) - Optional - Number of CPUs. - **StartVM** (SwitchParameter) - Optional - Switch to start the VM after deployment. ### Request Example ```powershell $fortiBuildParams = @{ ovf_path = "C:\FortiGate-VM64.vapp.ovf" vm_host = "fortipowerfgt-01" datastore = "data_fortipowerfgt-01" Cluster = "cluster_fortipowerfgt-01" inventory = "Firewall" name_vm = "Forti-VM" hostname = "powerfgt" dns_primary = "192.0.2.1" dns_secondary = "192.0.2.2" int0_network_mode = "Static" int0_gateway = "192.0.2.254" int0_ip = "192.0.2.10" int0_netmask = "255.255.255.0" int0_port_group = "powerfgt_vlan_01" net_adapter = "vmxnet3" int1_network_mode = "Static" int1_ip = "192.0.2.11" int1_netmask = "255.255.255.0" int1_port_group = "powerfgt_vlan_02" int2_network_mode = "Static" int2_ip = "192.0.2.12" int2_netmask = "255.255.255.0" int2_port_group = "powerfgt_vlan_03" int3_network_mode = "Static" int3_ip = "192.0.2.13" int3_netmask = "255.255.255.0" int3_port_group = "powerfgt_vlan_04" int4_network_mode = "Static" int4_ip = "192.0.2.14" int4_netmask = "255.255.255.0" int4_port_group = "powerfgt_vlan_05" int5_network_mode = "Static" int5_ip = "192.0.2.15" int5_netmask = "255.255.255.0" int5_port_group = "powerfgt_vlan_06" int6_network_mode = "Static" int6_ip = "192.0.2.16" int6_netmask = "255.255.255.0" int6_port_group = "powerfgt_vlan_07" int7_network_mode = "Static" int7_ip = "192.0.2.17" int7_netmask = "255.255.255.0" int7_port_group = "powerfgt_vlan_08" int8_network_mode = "Static" int8_ip = "192.0.2.18" int8_netmask = "255.255.255.0" int8_port_group = "powerfgt_vlan_09" int9_network_mode = "Static" int9_ip = "192.0.2.19" int9_netmask = "255.255.255.0" int9_port_group = "powerfgt_vlan_10" } Deploy-FGTVm @fortiBuildParams ``` ### Response #### Success Response (200) - **Status** (String) - Indicates the deployment status. - **Message** (String) - A message detailing the outcome of the deployment. #### Response Example ```json { "Status": "Success", "Message": "FortiGate VM deployed successfully." } ``` ``` -------------------------------- ### Configure FortiGate System Settings Source: https://context7.com/fortipower/powerfgt/llms.txt Shows how to retrieve and configure general system settings, including GUI options and operation mode. The -data parameter is available for specific configurations. ```powershell # Get system settings Get-FGTSystemSettings ``` ```powershell # Get specific system settings Get-FGTSystemSettings -Name gui-allow-unnamed-policy, opmode ``` ```powershell # Configure system settings Set-FGTSystemSettings -gui_allow_unnamed_policy ``` ```powershell # Configure using -data $data = @{ "location-id" = "192.0.2.1" } Set-FGTSystemSettings -data $data ``` -------------------------------- ### Get Syslogd Log Settings Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTLogSetting.md Retrieves the configuration for Syslogd log settings. This is a basic usage example. ```powershell Get-FGTLogSetting -type syslogd ``` -------------------------------- ### Connect to FortiGate and Prompt for Token Source: https://github.com/fortipower/powerfgt/blob/master/docs/Connect-FGT.md Connects to a FortiGate device and interactively prompts the user to enter the FortiToken code. ```powershell Connect-FGT -Server 192.0.2.1 -token_prompt ``` -------------------------------- ### Get All SAML Users Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTUserSAML.md Retrieves a list of all SAML users. No specific setup is required beyond having the PowerFGT module imported. ```powershell Get-FGTUserSAML ``` -------------------------------- ### FortiGate Connection and Action Parameters Source: https://github.com/fortipower/powerfgt/blob/master/docs/Set-FGTFirewallServiceCustom.md This snippet details parameters related to establishing connections and controlling cmdlet actions. ```APIDOC ## Connection and Action Parameters ### -connection #### Description {{ Fill connection Description }} #### Type PSObject #### Required False #### Default Value $DefaultFGTConnection ### -WhatIf #### Description Shows what would happen if the cmdlet runs. The cmdlet is not run. #### Type SwitchParameter #### Required False #### Aliases wi ### -Confirm #### Description Prompts you for confirmation before running the cmdlet. #### Type SwitchParameter #### Required False #### Aliases cf ### -ProgressAction #### Description {{ Fill ProgressAction Description }} #### Type ActionPreference #### Required False #### Aliases proga ``` -------------------------------- ### Configure FortiGate Global System Settings Source: https://context7.com/fortipower/powerfgt/llms.txt Demonstrates retrieving and setting global system parameters like admin timeout and admin sport. The -data parameter can be used for unsupported settings. ```powershell # Get all system global settings Get-FGTSystemGlobal ``` ```powershell # Get specific settings Get-FGTSystemGlobal -Name admintimeout, admin-sport ``` ```powershell # Configure system global settings Set-FGTSystemGlobal -admintimeout 30 -admin_sport 8443 ``` ```powershell # Configure using -data for unsupported parameters $data = @{ "two-factor-sms-expiry" = 120 } Set-FGTSystemGlobal -data $data ``` -------------------------------- ### Get Forticloud Local Log Events Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTLogEvent.md Retrieves log events from the forticloud source with the local subtype. This is a basic usage example. ```powershell Get-FGTLogEvent -type forticloud -subtype local ``` -------------------------------- ### Get All Antivirus Profiles Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTAntivirusProfile.md Retrieves all Antivirus Profile settings. No specific setup or imports are required beyond having the PowerFGT module loaded. ```powershell Get-FGTAntivirusProfile ``` -------------------------------- ### Configure multiple settings using -data parameter Source: https://github.com/fortipower/powerfgt/blob/master/docs/Set-FGTSystemSettings.md Configure multiple system settings simultaneously, like 'ike-port' and 'ike-policy-route', by passing a hashtable with all desired key-value pairs to the -data parameter. ```powershell $data = @{ "ike-port" = 1500 ; "ike-policy-route" = "enable"} PS C> Set-FGTSystemSettings -data $data ``` -------------------------------- ### Add FortiGate User Group with Multiple Members Source: https://github.com/fortipower/powerfgt/blob/master/docs/Add-FGTUserGroup.md This example demonstrates how to add a user group with multiple members simultaneously. List members separated by commas. ```powershell Add-FGTUserGroup -name MyUserGroup -member MyUser1, MyUser2 ``` -------------------------------- ### Get All RADIUS Servers Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTUserRADIUS.md Use this command to display all configured RADIUS servers. No specific setup is required beyond having the PowerFGT module imported. ```powershell Get-FGTUserRADIUS ``` -------------------------------- ### Get System Interface Status Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTMonitorSystemInterface.md Retrieves basic system interface information. No special setup is required beyond having the PowerFGT module imported. ```powershell Get-FGTMonitorSystemInterface ``` -------------------------------- ### Add multiple interfaces to a zone Source: https://github.com/fortipower/powerfgt/blob/master/docs/Add-FGTSystemZoneMember.md This example demonstrates how to add multiple interfaces to a zone simultaneously. Separate interface names with a comma. ```powershell Get-FGTSystemZone myPowerFGTZone | Add-FGTSystemZoneMember -interface port8, port9 ``` -------------------------------- ### Get All Firewall Local-In Policies Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTFirewallLocalInPolicy.md Retrieves a list of all firewall local-in policies. No specific setup is required beyond having the PowerFGT module imported. ```powershell Get-FGTFirewallLocalInPolicy ``` -------------------------------- ### Create Basic SDN Connector Source: https://github.com/fortipower/powerfgt/blob/master/docs/Add-FGTSystemSDNConnector.md Use this to create a new SDN Connector of type vCenter/ESX, providing the necessary server, username, and password. The password must be converted to a SecureString. ```powershell $mypassword = ConvertTo-SecureString mysecret -AsPlainText -Force PS C:\>Add-FGTSystemSDNConnector -name MySDNConnector -server MyVcenter -username powerfgt@vsphere.local -password $mypassword ``` -------------------------------- ### Invoke-FGTRestMethod - GET Request with Contains Filter Source: https://github.com/fortipower/powerfgt/blob/master/docs/Invoke-FGTRestMethod.md Filter results where an attribute contains a specific value. This example retrieves addresses where the name contains 'FGT'. ```powershell Invoke-FGTRestMethod -method "get" -uri "api/v2/cmdb/firewall/address" -filter_attribute name -filter_type contains -filter_value FGT ``` -------------------------------- ### Create VLAN Interface with Full Configuration Source: https://context7.com/fortipower/powerfgt/llms.txt Create a VLAN interface with detailed settings including alias, role, access permissions, IP addressing, and status. ```powershell Add-FGTSystemInterface -name "VLAN23" -alias "Production_VLAN" -role lan -vlan_id 23 -interface port10 -allowaccess https,ping,ssh -status up -device_identification $true -mode static -ip 192.0.2.1 -netmask 255.255.255.0 -vdom_interface root ``` -------------------------------- ### Invoke-FGTRestMethod - GET Request with Name Filter Source: https://github.com/fortipower/powerfgt/blob/master/docs/Invoke-FGTRestMethod.md Filter results based on a specific attribute value. This example retrieves addresses where the name is exactly 'FGT'. ```powershell Invoke-FGTRestMethod -method "get" -uri "api/v2/cmdb/firewall/address" -filter=name==FGT ``` -------------------------------- ### Get All Firewall Address Groups Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTFirewallAddressGroup.md Use this command to display all configured address groups. No specific setup is required beyond having the PowerFGT module imported. ```powershell Get-FGTFirewallAddressGroup ``` -------------------------------- ### Get Switch System Settings with Metadata Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTSwitchSystem.md Retrieves Switch System objects along with their metadata, such as usage information (q_ref). Use this when you need detailed operational metrics. ```powershell Get-FGTSwitchSystem -meta ``` -------------------------------- ### Add Basic FortiGate Firewall Policy Source: https://github.com/fortipower/powerfgt/blob/master/docs/Add-FGTFirewallPolicy.md Use this cmdlet to create a basic firewall policy with specified source and destination interfaces and addresses. ```powershell Add-FGTFirewallPolicy -name MyFGTPolicy -srcintf port1 -dstintf port2 -srcaddr all -dstaddr all ``` -------------------------------- ### Get Status from Syslog Setting 2 Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTLogSetting.md Retrieves the status of a specific Syslog server setting, identified by 'syslogd2'. This example demonstrates how to query a specific attribute. ```powershell Get-FGTLogSetting -type syslogd2 -name status ``` -------------------------------- ### Get Local Users by Name Filter Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTUserLocal.md Find local users whose names contain a specific string. This example searches for users with names containing 'FGT'. ```powershell Get-FGTUserLocal -name FGT -filter_type contains ``` -------------------------------- ### Add FortiGate Firewall Policy with a Schedule Source: https://github.com/fortipower/powerfgt/blob/master/docs/Add-FGTFirewallPolicy.md This example demonstrates adding a firewall policy that is active only during a specific schedule, like 'workhour'. ```powershell Add-FGTFirewallPolicy -name MyFGTPolicy -srcintf port1 -dstintf port2 -srcaddr all -dstaddr all -schedule workhour ``` -------------------------------- ### Configure VPN IPsec Phase 1 Interface with Data Parameter Source: https://github.com/fortipower/powerfgt/blob/master/docs/Add-FGTVpnIpsecPhase1Interface.md This example demonstrates creating a VPN IPsec Phase 1 Interface using the -data parameter to configure advanced options such as disabling fragmentation and NPU offload. ```powershell $data = @{ "fragmentation" = "disable" ; "npu-offload" = "disable" } PS C> Add-FGTVpnIpsecPhase1Interface -name PowerFGT_VPN -type static -interface port2 -psksecret MySecret -remotegw 192.0.2.1 -data $data ``` -------------------------------- ### Add ProxyAddress (method) Source: https://github.com/fortipower/powerfgt/blob/master/docs/Add-FGTFirewallProxyAddress.md Use this to add a ProxyAddress object of type method. This example restricts the allowed HTTP method to GET for a specific host object and includes a comment. ```powershell Add-FGTFirewallProxyAddress -Name FGT -method get -hostObjectName MyFGTAddress -comment "Get-only allowed to MyFGTAddress" ``` -------------------------------- ### FortiGate VM Build Parameters Source: https://github.com/fortipower/powerfgt/blob/master/docs/Deploy-FGTVm.md This PowerShell hashtable defines all necessary parameters for deploying a FortiGate VM, including network configuration, storage, and host details. Ensure all required fields are accurately populated. ```powershell $fortiBuildParams = @{ ovf_path = "C:\FortiGate-VM64.vapp.ovf" vm_host = "fortipowerfgt-01" datastore = "data_fortipowerfgt-01" Cluster = "cluster_fortipowerfgt-01" inventory = "Firewall" name_vm = "Forti-VM" hostname = "powerfgt" dns_primary = "192.0.2.1" dns_secondary = "192.0.2.2" int0_network_mode = "Static" int0_gateway = "192.0.2.254" int0_ip = "192.0.2.10" int0_netmask = "255.255.255.0" int0_port_group = "powerfgt_vlan_01" net_adapter = "vmxnet3" int1_network_mode = "Static" int1_ip = "192.0.2.11" int1_netmask = "255.255.255.0" int1_port_group = "powerfgt_vlan_02" int2_network_mode = "Static" int2_ip = "192.0.2.12" int2_netmask = "255.255.255.0" int2_port_group = "powerfgt_vlan_03" int3_network_mode = "Static" int3_ip = "192.0.2.13" int3_netmask = "255.255.255.0" int3_port_group = "powerfgt_vlan_04" int4_network_mode = "Static" int4_ip = "192.0.2.14" int4_netmask = "255.255.255.0" int4_port_group = "powerfgt_vlan_05" int5_network_mode = "Static" int5_ip = "192.0.2.15" int5_netmask = "255.255.255.0" int5_port_group = "powerfgt_vlan_06" int6_network_mode = "Static" int6_ip = "192.0.2.16" int6_netmask = "255.255.255.0" int6_port_group = "powerfgt_vlan_07" int7_network_mode = "Static" int7_ip = "192.0.2.17" int7_netmask = "255.255.255.0" int7_port_group = "powerfgt_vlan_08" int8_network_mode = "Static" int8_ip = "192.0.2.18" int8_netmask = "255.255.255.0" int8_port_group = "powerfgt_vlan_09" int9_network_mode = "Static" int9_ip = "192.0.2.19" int9_netmask = "255.255.255.0" int9_port_group = "powerfgt_vlan_10" } # end $fortiBuildParams ``` -------------------------------- ### Get UTM Application Categories Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTMonitorUtmApplicationCategories.md Retrieves UTM application categories, including their names and IDs. No specific setup is required beyond having the PowerFGT module imported and a connection established. ```powershell Get-FGTMonitorUtmApplicationCategories ``` -------------------------------- ### Get All Router BGP Neighbors Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTMonitorRouterBGPNeighbors.md Use this command to retrieve a list of all active BGP neighbors across all VDOMs. No specific setup is required beyond having the PowerFGT module imported. ```powershell Get-FGTMonitorRouterBGPNeighbors ``` -------------------------------- ### Connect to Multiple FortiGates Source: https://context7.com/fortipower/powerfgt/llms.txt Shows how to establish connections to multiple FortiGate devices simultaneously using the Connect-FGT cmdlet. Certificate checking can be skipped. ```powershell # Connect to multiple FortiGates $fw1 = Connect-FGT -Server 192.0.2.1 -SkipCertificateCheck -DefaultConnection:$false $fw2 = Connect-FGT -Server 192.0.2.2 -SkipCertificateCheck -DefaultConnection:$false ``` -------------------------------- ### Get System Interface Transceivers Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTMonitorSystemInterfaceTransceivers.md Retrieves information about the transceivers installed in the system's network interfaces, including interface name, type, vendor, part number, and serial number. ```APIDOC ## GET /api/v2/monitor/system/interface/transceivers ### Description Retrieves system interface transceiver information. ### Method GET ### Endpoint /api/v2/monitor/system/interface/transceivers ### Parameters #### Query Parameters - **vdom** (string) - Optional - Virtual domain to query. - **scope** (string) - Optional - Scope of the query (e.g., 'global'). Defaults to 'global'. ### Request Example ```json { "vdom": "root", "scope": "global" } ``` ### Response #### Success Response (200) - **interface** (string) - The name of the network interface. - **type** (string) - The type of transceiver. - **vendor** (string) - The vendor of the transceiver. - **part_number** (string) - The part number of the transceiver. - **serial_number** (string) - The serial number of the transceiver. #### Response Example ```json { "status": "success", "http_status": 200, "version": "7.2.5", "results": [ { "interface": "port1", "type": "SFP+ 10G", "vendor": "Finisar", "part_number": "FTLX1471D3BCL", "serial_number": "FGC123456789" } ] } ``` ``` -------------------------------- ### FortiGate Power Management Cmdlet Parameters Source: https://github.com/fortipower/powerfgt/blob/master/docs/Set-FGTVpnIpsecPhase1Interface.md This section outlines the parameters available for the power management cmdlets, including their types, requirements, and default values. ```APIDOC ## Power Management Cmdlet Parameters ### Parameters #### Common Parameters - **-networkid** (Int32) - Optional - Description: {{ Fill networkid Description }} - **-dpd** (String) - Optional - Description: {{ Fill dpd Description }} - **-dpdretrycount** (Int32) - Optional - Description: {{ Fill dpdretrycount Description }} - **-dpdretryinterval** (Int32) - Optional - Description: {{ Fill dpdretryinterval Description }} - **-idletimeout** (SwitchParameter) - Optional - Description: {{ Fill idletimeout Description }} - **-data** (Hashtable) - Optional - Description: {{ Fill data Description }} - **-vdom** (String[]) - Optional - Description: {{ Fill vdom Description }} - **-connection** (PSObject) - Optional - Description: {{ Fill connection Description }} - **-WhatIf** (SwitchParameter) - Optional - Description: Shows what would happen if the cmdlet runs. The cmdlet is not run. - **-Confirm** (SwitchParameter) - Optional - Description: Prompts you for confirmation before running the cmdlet. - **-ProgressAction** (ActionPreference) - Optional - Description: {{ Fill ProgressAction Description }} ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, and -WarningAction. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ``` -------------------------------- ### Get Switch Fortilink Settings Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTSwitchFortilinkSettings.md Retrieves a list of all Switch Fortilink Settings objects. This is the basic usage of the cmdlet. ```powershell Get-FGTSwitchSettings ``` -------------------------------- ### Get SSL VPN Information Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTMonitorVpnSsl.md Retrieves basic SSL VPN information, including username, remote host, and last login time. No special setup is required beyond establishing a connection. ```powershell Get-FGTMonitorVpnSsl ``` -------------------------------- ### Get Application List Settings with Metadata Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTApplicationList.md Retrieves Application List settings along with metadata, such as usage statistics (q_ref). Use the `-meta` switch for this purpose. ```powershell Get-FGTApplicationList -meta ``` -------------------------------- ### Get HA Peer Monitor Information Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTMonitorSystemHAPeer.md Use this command to retrieve HA Peer Monitor information, such as serial number, priority, and hostname. No specific setup is required beyond having the PowerFGT module imported. ```powershell Get-FGTMonitorSystemHAPeer ``` -------------------------------- ### Manage FortiGate System Administrator Accounts Source: https://context7.com/fortipower/powerfgt/llms.txt Examples for retrieving, creating, modifying trust hosts for, and removing administrator accounts. Super admin profile is used for creation. ```powershell # Get all admins Get-FGTSystemAdmin | Format-Table ``` ```powershell # Create an admin with super_admin profile $adminpass = ConvertTo-SecureString "adminpassword" -AsPlainText -Force Add-FGTSystemAdmin -Name "NewAdmin" -password $adminpass -accprofile super_admin ``` ```powershell # Modify admin trusthost Get-FGTSystemAdmin -name "NewAdmin" | Set-FGTSystemAdmin -trusthost1 192.0.2.0/24 ``` ```powershell # Remove an admin Get-FGTSystemAdmin -name "NewAdmin" | Remove-FGTSystemAdmin -Confirm:$false ``` -------------------------------- ### Get System Interface Transceivers Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTMonitorSystemInterfaceTransceivers.md Use this cmdlet to retrieve system interface transceiver details, including interface, type, vendor, Part Number, and Serial Number. No specific setup is required beyond having the PowerFGT module imported and a connection established. ```powershell Get-FGTMonitorSystemInterfaceTransceivers ``` -------------------------------- ### Add Basic Local In Policy Source: https://github.com/fortipower/powerfgt/blob/master/docs/Add-FGTFirewallLocalInPolicy.md Use this cmdlet to create a basic Local In Policy specifying the interface, source address, and destination address. Ensure the interface and addresses are valid for your FortiGate configuration. ```powershell Add-FGTFirewallLocalInPolicy -intf port1 -srcaddr all -dstaddr all ``` -------------------------------- ### Invoke-FGTRestMethod - Basic GET Request Source: https://github.com/fortipower/powerfgt/blob/master/docs/Invoke-FGTRestMethod.md This snippet demonstrates a basic GET request to the firewall address API using Invoke-FGTRestMethod. ```APIDOC ## POST /api/v2/cmdb/firewall/address ### Description This endpoint is used to retrieve firewall address objects. ### Method GET ### Endpoint /api/v2/cmdb/firewall/address ### Parameters #### Query Parameters - **method** (String) - Optional - The HTTP method to use (defaults to GET). - **uri** (String) - Required - The API endpoint URI. - **vdom** (String[]) - Optional - Specifies the VDOM to target. - **filter** (String) - Optional - A filter string for the query. - **filter_attribute** (String) - Optional - The attribute to filter on. - **filter_type** (String) - Optional - The type of filter (e.g., 'contains'). - **filter_value** (PSObject) - Optional - The value to filter by. - **uri_escape** (String) - Optional - A string to be URI-encoded. - **extra** (String) - Optional - Additional query parameters to append to the URI. - **connection** (PSObject) - Optional - The FortiGate connection object. - **skip** (SwitchParameter) - Optional - If set, skips some value. - **meta** (SwitchParameter) - Optional - If set, includes metadata in the response. ### Request Example ```powershell Invoke-FGTRestMethod -method "get" -uri "api/v2/cmdb/firewall/address" ``` ### Response #### Success Response (200) - **data** (Array) - A list of firewall address objects. - **meta** (Object) - Metadata about the response (if requested). #### Response Example ```json { "data": [ { "name": "MyAddress", "subnet": "192.168.1.0/24" } ], "meta": { "offset": 0, "limit": 100, "total": 1 } } ``` ``` -------------------------------- ### Deploy FortiGate VM Cmdlet Call Source: https://github.com/fortipower/powerfgt/blob/master/docs/Deploy-FGTVm.md This command invokes the Deploy-FGTVm cmdlet, passing the previously defined build parameters as an array. This is the primary command for initiating the FortiGate VM deployment process. ```powershell Deploy-FGTVm @fortiBuildParams ``` -------------------------------- ### Configure Firewall Policy Logging with Data Parameter Source: https://github.com/fortipower/powerfgt/blob/master/docs/Set-FGTFirewallPolicy.md Enable specific logging features for a FortiGate firewall policy using the -data parameter with a hashtable. This example enables 'logtraffic-start'. Ensure the policy name is correct. ```powershell $data = @{"logtraffic-start" = "enable" } PS C:\>$MyFGTPolicy = Get-FGTFirewallPolicy -name MyFGTPolicy PS C:\>$MyFGTPolicy | Set-FGTFirewallPolicy -data $color ``` -------------------------------- ### Get SD-WAN Schema Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTSystemSDWAN.md Retrieves the schema definition for System SD-WAN settings. Use the -schema parameter to get the structure of the configuration. ```powershell Get-FGTSystemSDWAN -schema ``` -------------------------------- ### Add FortiGate Firewall Policy with Deny Action Source: https://github.com/fortipower/powerfgt/blob/master/docs/Add-FGTFirewallPolicy.md Use this cmdlet to create a firewall policy with a 'deny' action, blocking traffic that matches the policy criteria. ```powershell Add-FGTFirewallPolicy -name MyFGTPolicy -srcintf port1 -dstintf port2 -srcaddr all -dstaddr all -action "deny" ``` -------------------------------- ### Get All Firewall Address Groups Source: https://github.com/fortipower/powerfgt/blob/master/README.md Retrieves all firewall address groups and displays them in a table format. Useful for auditing or getting an overview of existing groups. ```powershell Get-FGTFirewallAddressgroup | Format-Table ``` -------------------------------- ### Add FortiGate Address Group with Multiple Members Source: https://github.com/fortipower/powerfgt/blob/master/docs/Add-FGTFirewallAddressGroup.md This example demonstrates adding an Address Group with multiple members by providing a comma-separated string of member names. All specified members must exist. ```powershell Add-FGTFirewallAddressGroup -name MyAddressGroup -member MyAddress1, MyAddress2 ``` -------------------------------- ### Invoke-FGTRestMethod - Basic GET Request Source: https://github.com/fortipower/powerfgt/blob/master/docs/Invoke-FGTRestMethod.md Use this cmdlet to perform a GET request to a specified URI on the FortiGate device. Ensure you have an active FGT connection. ```powershell Invoke-FGTRestMethod -method "get" -uri "api/v2/cmdb/firewall/address" ``` -------------------------------- ### Get Specific Webfilter Profile by Name Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTWebfilterProfile.md Fetches the configuration for a Webfilter Profile that matches the specified name. Use this to get details of a single profile. ```powershell Get-FGTWebfilterProfile -name myWebfilterProfile ``` -------------------------------- ### Add FortiGate VIP Group with data Source: https://github.com/fortipower/powerfgt/blob/master/docs/Add-FGTFirewallVipGroup.md This example demonstrates adding a VIP group with a member and custom data, such as a color attribute. ```powershell $data = @{ "color" = "23"} PS C> Add-FGTFirewallVipGroup -name MyVipGroup -member MyVip1 -interface wan1 -data $data ``` -------------------------------- ### Invoke-FGTRestMethod - GET Request with Skip Parameter Source: https://github.com/fortipower/powerfgt/blob/master/docs/Invoke-FGTRestMethod.md Perform a GET request and include the 'skip' parameter. This is often used for pagination to skip a certain number of records. ```powershell Invoke-FGTRestMethod -method "get" -uri "api/v2/cmdb/firewall/address" -skip ``` -------------------------------- ### Get VPN SSL Portal Schema Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTVpnSSLPortal.md Retrieves the schema definition for VPN SSL Portals. Use the '-schema' switch to get the structure and available fields. ```powershell Get-FGTVpnSSLPortal -schema ``` -------------------------------- ### Get Switch Fortilink Settings with Metadata Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTSwitchFortilinkSettings.md Retrieves Switch Fortilink Settings objects along with their metadata, such as usage information (q_ref). This is useful for monitoring or auditing purposes. ```powershell Get-FGTSwitchSettings -meta ``` -------------------------------- ### Create SDN Connector with Disabled Status and Verification Source: https://github.com/fortipower/powerfgt/blob/master/docs/Add-FGTSystemSDNConnector.md This example demonstrates creating an SDN Connector with the status explicitly set to disabled and certificate verification turned off. Ensure the password is a SecureString. ```powershell $mypassword = ConvertTo-SecureString mysecret -AsPlainText -Force PS C:\>Add-FGTSystemSDNConnector -name MySDNConnector -server MyVcenter -username powerfgt@vsphere.local -password $mypassword -status:$false -verify_certificate:false ``` -------------------------------- ### Invoke-FGTRestMethod - GET Request on Specific VDOM Source: https://github.com/fortipower/powerfgt/blob/master/docs/Invoke-FGTRestMethod.md Execute a GET request to a specific URI on a designated VDOM. This is useful for managing resources within a particular virtual domain. ```powershell Invoke-FGTRestMethod -method "get" -uri "api/v2/cmdb/firewall/address" -vdom vdomX ``` -------------------------------- ### Get Specific Switch LLDP Profile by Name Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTSwitchLLDPProfile.md Retrieves a Switch LLDP Profile object that matches the specified name. Use this to get details for a particular profile. ```powershell Get-FGTSwitchLLDPProfile -name MyProfile ``` -------------------------------- ### Create Zone with Interfaces Source: https://context7.com/fortipower/powerfgt/llms.txt Create a new firewall zone, specifying its name, intra-zone traffic policy, and initial member interfaces. ```powershell Add-FGTSystemZone -name "MyZone" -intrazone allow -interfaces port5, port6 ``` -------------------------------- ### Get Firewall Policy by UUID Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTFirewallPolicy.md Retrieves a firewall policy using its universally unique identifier (UUID). This ensures you get a specific policy even if names change. ```powershell Get-FGTFirewallPolicy -uuid 9e73a10e-1772-51ea-a8d7-297686fd7702 ``` -------------------------------- ### Get information about ALL SDN connectors Source: https://github.com/fortipower/powerfgt/blob/master/README.md Retrieves information about all configured SDN connectors. Use `Format-Table` for a clear, tabular output. ```powershell Get-FGTSystemSDNConnector | Format-Table ``` -------------------------------- ### Get Wireless Settings with Skipped Objects Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTWirelessSetting.md Retrieves wireless setting objects, ignoring a specified number of initial objects. Use the -skip parameter to get only relevant attributes after skipping. ```powershell Get-FGTWirelessSetting -skip ``` -------------------------------- ### Get All System Settings - PowerFGT Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTSystemSettings.md Retrieves a list of all available system settings. This is the default behavior when no parameters are specified. ```powershell Get-FGTSystemSettings ``` -------------------------------- ### Get System Interfaces with Skipped Attributes Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTSystemInterface.md Retrieves a list of all network interfaces, but omits certain attributes to provide a more concise output. Use the `-skip` switch to get only the most relevant attributes. ```powershell Get-FGTSystemInterface -skip ``` -------------------------------- ### Connect to FortiGate Firewall Source: https://github.com/fortipower/powerfgt/blob/master/README.md Use this cmdlet to establish a connection to your FortiGate firewall. Specify the IP address and optionally the port. ```powershell Connect-FGT 192.0.2.1 -port 4443 ``` -------------------------------- ### Get Proxy Address Groups with Skipped Attributes Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTFirewallProxyAddressGroup.md Retrieves all proxy address groups but omits certain less relevant attributes. Use the '-skip' switch to get a more concise output. ```powershell Get-FGTFirewallProxyAddressGroup -skip ``` -------------------------------- ### PowerFGT Cmdlet Parameters Source: https://github.com/fortipower/powerfgt/blob/master/docs/Add-FGTVpnIpsecPhase2Interface.md This section outlines the common parameters used across PowerFGT cmdlets for configuring network objects and settings on FortiGate devices. ```APIDOC ## PowerFGT Cmdlet Parameters ### Description This section details the parameters available for configuring network objects and settings on FortiGate devices using PowerFGT cmdlets. ### Parameters #### Common Parameters - **-srcip** (String) - Optional - Source IP address. - **-srcnetmask** (String) - Optional - Source network mask. - **-srcrange** (String) - Optional - Source IP address range. - **-dstip** (String) - Optional - Destination IP address. - **-dstnetmask** (String) - Optional - Destination network mask. - **-dstrange** (String) - Optional - Destination IP address range. - **-data** (Hashtable) - Optional - Data payload for the command. - **-vdom** (String[]) - Optional - Virtual domain(s) to apply the configuration to. - **-connection** (PSObject) - Optional - Specifies the connection object to the FortiGate device. Defaults to `$DefaultFGTConnection`. - **-ProgressAction** (ActionPreference) - Optional - Specifies how this cmdlet responds to the progress bar. Aliases: proga. ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ### INPUTS ### OUTPUTS ### NOTES ### RELATED LINKS ``` -------------------------------- ### Get VPN SSL Settings with Skip Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTVpnSSLSettings.md Retrieves VPN SSL settings, skipping the initial set of objects to get only relevant attributes. Use this to paginate or retrieve specific subsets of data. ```powershell Get-FGTVpnSSLSettings -skip ``` -------------------------------- ### Configure FortiGate LDAP Authentication Server Source: https://context7.com/fortipower/powerfgt/llms.txt Shows how to add and configure an LDAP server for authentication. Requires server details, DN, username, and password. ```powershell # Create LDAP server $ldappass = ConvertTo-SecureString "ldappassword" -AsPlainText -Force Add-FGTLDAP -Name "MyLDAP" -server ldap.example.com -dn "dc=example,dc=com" -username svc_fgt -password $ldappass ``` -------------------------------- ### Configure Admin Two-Factor Authentication with Set-FGTSystemAdmin Source: https://github.com/fortipower/powerfgt/blob/master/docs/Set-FGTSystemAdmin.md Use the -data parameter to configure advanced settings like two-factor authentication. This example sets the two-factor method to email and specifies the recipient email address. ```powershell $data = @{ "two-factor" = "email" ; "email-to" = "admin@fgt.power" } PS > $MyFGTAdmin = Get-FGTSystemAdmin -name MyFGTAdmin PS > $MyFGTAdmin | Set-FGTSystemAdmin -data $data ``` -------------------------------- ### Get Router BGP Objects with Skipped Attributes Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTRouterBGP.md Retrieves all router BGP objects, but only includes the most relevant attributes by ignoring others. Use this to get a concise list of essential BGP information. ```powershell Get-FGTRouterBGP -skip ``` -------------------------------- ### Get All Application List Settings Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTApplicationList.md Retrieves all available Application List settings. This is the default behavior when no parameters are specified. ```powershell Get-FGTApplicationList ``` -------------------------------- ### Update Firewall Address with IP Range Start IP Source: https://github.com/fortipower/powerfgt/blob/master/docs/Set-FGTFirewallAddress.md Use this cmdlet to update the starting IP address for an IP range type firewall address. Ensure the address object is retrieved first. ```powershell $MyFGTAddress = Get-FGTFirewallAddress -name MyFGTAddress PS C:\>$MyFGTAddress | Set-FGTFirewallAddress -startip 192.0.2.100 ``` -------------------------------- ### Get Virtual WAN Link Settings with Skip Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTSystemVirtualWANLink.md Retrieves Virtual WAN Link settings, skipping a specified number of objects to get subsequent ones. Useful for pagination or retrieving specific subsets of data. ```powershell Get-FGTSystemVirtualWANLink -skip ``` -------------------------------- ### Add FortiGate Local User with SMS Two-Factor Authentication and Data Parameter Source: https://github.com/fortipower/powerfgt/blob/master/docs/Add-FGTUserLocal.md This example shows how to add a local user with password, enabling two-factor authentication via SMS. The SMS phone number is provided using the -data parameter, and an email address is also specified for notifications. ```powershell $data = @{ "sms-phone" = "XXXXXXXXXX" } PS > $mypassword = ConvertTo-SecureString mypassword -AsPlainText -Force PS > Add-FGTUserLocal -Name MyFGTUserLocal -passwd $mypassword -status -two_factor sms -data $data -email_to powerfgt@fgt.power ``` -------------------------------- ### Get VPN SSL Portals with Metadata Source: https://github.com/fortipower/powerfgt/blob/master/docs/Get-FGTVpnSSLPortal.md Retrieves VPN SSL Portal settings along with metadata, such as usage information (q_ref). Use the '-meta' switch to include this additional data. ```powershell Get-FGTVpnSSLPortal -meta ``` -------------------------------- ### Install and Import PowerFGT Module Source: https://github.com/fortipower/powerfgt/blob/master/README.md Automated installation of the PowerFGT module using Install-Module. Import the module to make its commands available and use Get-Command to list available cmdlets. Get-Help provides detailed information on specific cmdlets. ```powershell Install-Module PowerFGT ``` ```powershell Import-Module PowerFGT ``` ```powershell Get-Command -Module PowerFGT ``` ```powershell Get-Help Get-FGTFirewallAddress -Full ```