Step 1: Prepare Your CSV File
You’ll need a CSV file with at least the following two columns:

The
username
must match exactly with the usernames in your Moodle site.The
suspended
field is set to1
to suspend the user (set to0
to unsuspend).
You can add more fields if needed, but only these two are necessary for suspension.
Step 2: Go to the Upload Users Page
Log in as a Site Administrator.
Go to:
Site administration > Users > Accounts > Upload users
Step 3: Upload the CSV File
Upload your CSV file using the file picker or drag-and-drop.
Click Upload users.
Step 4: Set Upload Settings
On the preview screen:
Upload type: Leave as “Add new and update existing users”
Existing user details: Choose "Override with file"
Allow suspending and deleting accounts: Make sure this is set to Yes
Other settings can remain at default unless needed.
Then click Upload users.
Step 5: Confirm Upload and Check Results
You’ll see a confirmation page listing the results.
Suspended users won’t be able to log in until they are unsuspended.