So far I didn’t need to make a massive suspension of users, but today, it was the day !
Here are two relevant articles I found in Moodle.docs, always, the first place to look for !
To be frank I was expecting to find a separate paragraph about “Suspending Users”, rather than a note and a tip in different paragraphs.
Also, although it’s mentioned that a user can be suspended through his/hers profile, I haven’t seen that option in practice. Instead I have to make a site level search
Site administration -> Users -> Accounts -> Browse list of users and "close the eye" of the user or
unenrol the user from course level
Course administration -> Users -> Enrolled users and click the x icon next to the user's name.
Anyway, until someone who knows better reviews the articles, the best option for suspending multiple accounts is the cvs file.
Don’t be surprised though that this can be done through the “Upload users” option
Site administration -> Users -> Upload users, using a cvs file like the following one:
username,firstname,lastname,email,suspended kothar.alma,Kothar,Alma,firstname.lastname@example.org,1 prent.sai,Prent,Sai,email@example.com,1
Particularly cool though, is the Upload users results list that appears after the “Upload” (perhaps this button should be renamed to “upload/update”? or “Save changes”?) with the details of each account’s status.