FortiSIEM
FortiSIEM provides Security Information and Event Management (SIEM) and User and Entity Behavior Analytics (UEBA)
mbenvenuti
Staff
Staff
Article Id 407045
Description This article describes how to remove users from the command line.
Scope FortiSIEM.
Solution

Those steps can be followed when the user cannot be removed from the GUI. A bulk removal from the GUI can take some time till ending in a timeout, and some actions can remain pending.

 

  1. Catch the ID of the user: From the super CLI as root, search based on the username and replace name_of_the_user_to_delete:

 

user_id=`psql -U phoenix phoenixdb -At -c "select id from ph_user where name = 'name_of_the_user_to_delete'" | head -n1`

 

  1. Check the user ID:

 

echo $user_id

 

Make sure a numeric value is displayed; otherwise, renew the first step.

 

  1. Remove the dependencies and the user:

 

psql -U phoenix phoenixdb -c "delete from ph_contact where id in (select contact_id from ph_user2contact where user_id = ${user_id});"
psql -U phoenix phoenixdb -c "delete from ph_user2contact where user_id = ${user_id};"
psql -U phoenix phoenixdb -c "delete from ph_user_domain_mapping where user_id = ${user_id};"
psql -U phoenix phoenixdb -c "delete from ph_user where id = ${user_id};"

 

The user is now removed, and will not be displayed anymore in the GUI CMDB after refreshing the page.

Contributors