Expiration Date for Users

Hi.

is there a chance to get an expiration date function also for users ?

This would be a helpful feature for using ownCloud with many external users and an additional security feature.

Thank you.

Best regards. Holger

Hi Holger,

Depends on what you want to achieve.
There are a bunch of occ commands that could be helpful in programming a little cron one-liner to automatically disable inactive users:
https://doc.owncloud.com/server/10.2/admin_manual/configuration/server/occ_command.html#finding-inactive-users
https://doc.owncloud.com/server/10.2/admin_manual/configuration/server/occ_command.html#disable-users

A one-liner could look like this:

occ user:inactive 90 | grep uid | awk '"'"'{print $3}'"'"' | while read user; do occ user:disable ${user}; done;

I would recommend to only disable users, as their data would immediately get deleted if you use user:delete

Make sure you test your cron job properly in a safe environment before accidentally deleting/disabling production users.

2 Likes

Super. Perfect. This works for me.

1 Like