Delete multiple Users

Hi,

how can I delete multiple users at once? We have to rework the user list quite a lot and until now I only found out how to delete 1 user by 1 with the admin interface.

Thanks!

You can delete a single user:
sudo -u www-data php occ user:delete username
(please test it first)

If you have got al text file “user.txt” with a list of users i think you can use a script to delete them:

for i in $(cat user.txt);do sudo -u www-data php occ user:delete $i;done
(sorry not tested)

Using the occ command — Nextcloud latest Administration Manual latest documentation

If you only can use the web interface i think you have no possibility.
For bigger installation i think it is necessary to have shell access (ssh).
With OCC Web OCC Web - Apps - App Store - Nextcloud (not in Nextcloud 19) you can not use the script above.

thanks for the answer!

For anyone else looking how to do this; You an generate a list of all the users using occ user:list.