Inactivity Manager

Plugin: local_inactivity_manager Availability: All Open LMS clients

 

Overview

The Inactivity Manager plugin automatically suspends and deletes dormant user accounts based on configurable inactivity thresholds. Once configured, the entire process runs through scheduled tasks with no manual intervention required.

This helps administrators keep their user base clean and can reduce unnecessary flex seat costs caused by inactive accounts.

 

How It Works

The plugin runs as a scheduled task and applies the rules you configure:

  1. Suspension — Accounts that have been inactive longer than the configured threshold are suspended automatically. Different thresholds can be set for accounts that have logged in before and accounts that have never logged in.
  2. Deletion queue — Suspended accounts that remain inactive beyond the deletion threshold are permanently removed, but only if account deletion has been explicitly enabled.
  3. Administrator reactivation — If an administrator manually reactivates (unsuspends) an account that is in the deletion queue, the account is removed from the queue and will not be deleted.

For users who have never logged in, the timer starts from the account creation date — so accounts cannot be suspended immediately on creation.

 

Configuration

All settings are located under Site Administration → Plugins → Local plugins → Inactivity Manager.

Enable Inactivity Manager

Setting: enableinactivitymanager Default: No

Master switch. When enabled, the scheduled task will process inactive accounts according to the rules below. When disabled, no accounts will be suspended or deleted regardless of other settings.

 

Screenshot 2026-05-25 at 11.44.48 AM.png

 

Suspend users who have accessed before

Setting: enablesuspendaccessed Default: Yes

When enabled, users who have logged in at least once and have been inactive for the configured number of days will be suspended.

Suspend inactive accounts (days)

Setting: timetosuspend Default: 180

Number of days of inactivity after which previously-accessed accounts will be suspended.

Screenshot 2026-05-25 at 11.44.54 AM.png

Suspend users who have never accessed

Setting: enablesuspendneveraccessed Default: Yes

When enabled, users who have never logged in and whose accounts were created longer ago than the configured number of days will be suspended.

Suspend never-accessed accounts (days)

Setting: timetosuspendneveraccessed Default: 180

Number of days after account creation to suspend never-accessed accounts.

Screenshot 2026-05-25 at 11.45.00 AM.png

 

Enable deletion of accounts

Setting: enabledeleteaccounts Default: No

When enabled, the scheduled task will permanently delete accounts that have been suspended for longer than the configured deletion threshold.

This is intentionally disabled by default. Account deletion is permanent and requires explicit administrative intent.

Days (until deletion)

Setting: timetodelete Default: 365

Number of days after suspension to permanently delete a user account.

Screenshot 2026-05-25 at 11.47.19 AM.png

Typical Configuration Example

A common setup for a customer using default behavior:

  1. Set Enable Inactivity Manager to Yes.
  2. Leave Suspend users who have accessed before and Suspend users who have never accessed enabled with the 180-day defaults.
  3. Leave Enable deletion of accounts disabled until you have validated suspension behaviour for at least one cycle.
  4. After validation, enable account deletion with the 365-day default.

This configuration suspends inactive users after 6 months and deletes them after a further 12 months of inactivity.

 

Important Notes

  • Administrator reactivation cancels deletion. If an administrator manually un-suspends or reactivates an account that is in the deletion queue, the account is removed from the queue and will not be deleted on the next scheduled task run.
  • Deletion is permanent. Once an account is deleted by this plugin, it cannot be recovered through the plugin. Account deletion is handled by core Moodle functionality.
  • The deletion setting is opt-in. Account deletion will not occur unless Enable deletion of accounts is explicitly enabled, even if all other settings are active.
  • Recommended approach for new deployments. Enable suspension first, monitor the results, and enable deletion only once you are confident in the configuration.
Was this article helpful?
1 out of 1 found this helpful