With local user expire -plugin you can
- Define expiration date for user accounts on which these accounts will be disabled or deleted from the system. You can set expiration date for a single user account in user account settings or you can define expiration date for multiple accounts with a prebuild CSV-file.
- Disables or delete user accounts automatically if they match specified last login or create date e.g. delete all user accounts that last login or create date is 2 years or higher. This service is by default run once every night.
Disabled users cannot log in to the system and they don't receive any emails from Moodle but their submissions/grades are kept on courses.
Both of these features work independently of each other so you can decide if you want use only one of them or both.