brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: occ user:report counts your Nextcloud users per backend

Nextcloud
~/tips/tip-nextcloud-occ-user-report

sudo -E -u www-data php occ user:report

Prints a small table with total, active and disabled accounts, split by user backend.

How many accounts does my Nextcloud have? occ answers that in one line.

sudo -E -u www-data php occ user:report

The docs show a table like this one:

| Database         | 12 |
| LDAP             | 86 |
| total users      | 98 |
| user directories | 2  |
| active users     | 15 |
| disabled users   | 0  |

The first rows are the user backends, so a server that mixes local accounts with LDAP shows both. That makes it a quick check after you connect a directory, to see whether the expected number of people came through.

The caveat is in how the docs define the numbers. Active users are accounts that logged in at least once. Someone who was created but never logged in counts as neither active nor disabled. Some backends cannot count their users and may show zero, so a zero is not proof of an empty directory.

For a home server with a handful of accounts it is a curiosity. Together with occ user:lastseen --all it tells you how much of your user list is real use.

Further reading: Nextcloud admin manual: user and group commands

Going deeper: Guide: put Nextcloud behind Nginx Proxy Manager with HTTPS and the right headers

More Nextcloud tips sudo -E -u www-data php occ app:update --showonly sudo -E -u www-data php occ background-job:history -s 3 -l 10 docker exec --user www-data nextcloud php occ maintenance:mode --on docker exec -it --user www-data nextcloud php occ user:resetpassword layla docker exec -it --user www-data nextcloud php occ log:watch All Nextcloud tips (13) All topics

Link