Kanimozhi
Kanimozhiβ€’3mo ago

Deleting Bulk Users

Hey @Rajat , I am in need to clean up unwanted/unused users created in zitadel. It is actually 3 digit count, which means manually deleting each user will be difficult and time taking process. I directly accessed db and deleted the users with certain key using dbquery, but yet I can see those users listed in the console. By search I got to know like as zitadel is event based so it will be displayed based on the event. This db query check I have done in another instance not in the actual instance. Is there any ways to handle this?
6 Replies
Rajat
Rajatβ€’3mo ago
hey @Kanimozhi direct DB deletion won’t work in ZITADEL because it’s an event-sourced system,data is rebuilt from events, not direct table rows πŸ™‚ you need to search/list your unwanted/unused users and then delete then run a loop and delete them this will store a new "user removed" event and performs cleanup.
Kanimozhi
KanimozhiOPβ€’3mo ago
Yeah, Thanks @Rajat . Actually I have wrote a script to get and delete the users in loop.
Rajat
Rajatβ€’3mo ago
hey @Kanimozhi awesome!!. Please mark my answer with βœ… and it will auto close the question πŸ™‚
Kanimozhi
KanimozhiOPβ€’3mo ago
I tried to mark solution with βœ…, but is saying not enabled.
Rajat Singh
Rajat Singhβ€’3mo ago
hey @Kanimozhi its okay, I marked it solved πŸ˜„
Kanimozhi
KanimozhiOPβ€’3mo ago
Thanks @Rajat Singh 😁

Did you find this page helpful?