Technical Tip: How to remove users from the command line
| 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.
user_id=`psql -U phoenix phoenixdb -At -c "select id from ph_user where name = 'name_of_the_user_to_delete'" | head -n1`
echo $user_id
Make sure a numeric value is displayed; otherwise, renew the first step.
psql -U phoenix phoenixdb -c "delete from ph_contact where id in (select contact_id from ph_user2contact where user_id = ${user_id});"
The user is now removed, and will not be displayed anymore in the GUI CMDB after refreshing the page. |