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

Fortitoken(monitor): Add Get-FGTUserFortiToken for get user FortiToken #279

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions PowerFGT/Public/monitor/user/fortitoken.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#
# Copyright 2024, Alexis La Goutte <alexis dot lagoutte at gmail dot com>
#
# SPDX-License-Identifier: Apache-2.0
#
function Get-FGTMonitorUserFortitoken {

<#
.SYNOPSIS
Get User Fortitoken

.DESCRIPTION
Get User FortiToken ( description, type, license, status... )

.EXAMPLE
Get-FGTMonitorUserFortitoken

Get User Fortitoken information

#>

Param(
[Parameter(Mandatory = $false)]
[String[]]$vdom,
[Parameter(Mandatory = $false)]
[psobject]$connection = $DefaultFGTConnection
)

Begin {
}

Process {

$invokeParams = @{ }
if ( $PsBoundParameters.ContainsKey('vdom') ) {
$invokeParams.add( 'vdom', $vdom )
}

$uri = 'api/v2/monitor/user/fortitoken'

$response = Invoke-FGTRestMethod -uri $uri -method "GET" -body $body -connection $connection @invokeParams
$response.results

}

End {
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1310,6 +1310,7 @@ It is possible to `monitor` FortiGate
* `Get-FGTMonitorSystemInterface` Retrieve statistics for all system interfaces
* `Get-FGTMonitorSystemHAChecksum` List of checksums for members of HA cluster
* `Get-FGTMonitorSystemHAPeer` Get configuration of peer(s) in HA cluster
* `Get-FGTMonitorUserFortitoken` Retrieve a map of FortiTokens and their status
* `Get-FGTMonitorUtmApplicationCategories` Get list of (UTM) Application Categories
* `Get-FGTMonitorVpnIPsec` Return active IPsec VPNs
* `Get-FGTMonitorVpnSsl` Retrieve a list of all SSL-VPN sessions and sub-sessions and Return statistics about the SSL-VPN
Expand Down
3 changes: 3 additions & 0 deletions Tests/integration/Connection.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@ Describe "Connect to a FortiGate (using multi connection)" {
It "Use Multi connection for call Get Monitor Network ARP (< 6.4.0)" -skip:($fgt_version -ge "6.4.0") {
{ Get-FGTMonitorNetworkARP -connection $fgt } | Should -Throw "Monitor Network ARP is not available before Forti OS 6.4"
}
It "Use Multi connection for call Get Monitor User Fortitoken" {
{ Get-FGTMonitorUserFortitoken -connection $fgt } | Should -Not -Throw
}
It "Use Multi connection for call Get Monitor UTM Application Categories" {
{ Get-FGTMonitorUtmApplicationCategories -connection $fgt } | Should -Not -Throw
}
Expand Down
Loading