Marking multiple account as Suspended account

AI-generated summary

Marking Multiple Accounts as Suspended

Jaskaran needs to mark 500 user profiles as suspended and is planning to do this using the Rails console. The user aims to set the suspended_at field to the current date and suspended_till field to a specific date in 3024.

JammyDodger suggested using either the API or Rails console, and Jaskaran confirmed they plan to use the Rails console. JammyDodger shared a relevant link from Meta Discourse (https://meta.discourse.org/t/administrative-bulk-operations/118349#suspend-a-set-of-users-based-on-criteria) for guidance.

pfaffman advised figuring out how to retrieve the users and then using update_all to make the changes. Jaskaran thanked everyone for their help.

When a user is marked as suspended from the UI, the backend updates the suspended_at and suspended_till fields in the user table. I have 500 users whose profiles need to be marked as suspended. I’m planning to retrieve these user IDs based on their group ID and set the suspended_at field to: current date
and the suspended_till field to:
‘Sun, 01 Aug 3024 02:30:00.000000000 UTC +00:00’

Can anyone suggest the best way to accomplish this?

I think you would need to do this either through the API or using the rails console.

Are you familiar with either of these options?

Yes i am planning to do this using rails console

There’s some advice on this in Administrative Bulk Operations

Figure out how to get the users and then use update_all.

I think ChatGPT can tell you pretty well

Thank you so much everyone. I always find it pretty cool to see replies. Big love!