Delete multiple Users


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.


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)

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 (not in Nextcloud 19) you can not use the script above.

thanks for the answer!