Skip to main content
yeowkm99
New Member
September 1, 2022
Question

Export forti token users in fortigate

  • September 1, 2022
  • 3 replies
  • 2709 views

how do i export the forti token users list in my fortigate?

i have about 180 users in the list

3 replies

kcheng
Staff & Editor
Staff & Editor
September 1, 2022

Hi @yeowkm99 

 

Unfortunately, it would not be possible to export FortiToken user list. You can either obtain the respective from the configuration file, or copy the respective information in the GUI.

rosatechnocrat
Explorer III
September 1, 2022

Dear Yeowkm99,

There is no direct option to export the users. You can use below methods: 

 

1. manually copy and paste them from the config ( in CLI show)
2. manually copy and paste one by one from the GUI 

Easiest way is the below

-------------------------
3. run the command on the CLI to check the list and copy+paste it manually:

# show | grep -f two-factor

Subscribe "ROSA Technocrat" on Youtube for Fortinet Videos and Troubleshooting https://www.youtube.com/@rosatechnocrat
Duna
New Member
August 29, 2025

You can use linux and small scripting :)

###### Fortigate: ######

ssh from linux

ssh <fortigate> | tee temp-output.txt

 

config system console

    set output standard

end

 

show full-configuration user local

 

config system console

    set output more

end

 

###### Linux: ######

cat temp-output.txt | egrep 'edit|status|type|two-factor|FTK|mail' | sed 's/set//;s/\r//g' > user-list-tokens.txt

echo "USER;STATUS;TYPE;2FACTOR METHOD;DEVICE;;EMAIL" > user-list-tokens.csv


cat user-list-tokens.txt |tr -d '\n' | sed 's/edit/\n/g;s/status/;status/g;s/type/;type/g;s/two-factor fortitoken/;two-factor fortitoken/g;s/two-factor email/;two-factor email;/g;s/fortitoken "FT/;FT/g;s/email-to/;email-to;/g;s/two-factor disable/;two-factor disable;/g' >> user-list-tokens.csv



Import csv to excel sheet
Excel formulas:

Number of  users using  fortitoken auth

=COUNTIF(user_list_tokens[2FACTOR METHOD];"*fortitoken*")

Number of users using  email token

=COUNTIF(user_list_tokens[2FACTOR METHOD];"*email*")

Number of users without  MFA

=COUNTIFS(user_list_tokens[2FACTOR METHOD];"*disable*";user_list_tokens[STATUS];"*enable*")