Bulk Removing Users

Request Type: 
General Assistance
Author: 
Benjamin Rogalski
Issue/Request: 

Hello,

Is it possible to bulk remove a list of users?

Every year we want to bulk import the incoming students (as users) and remove the outgoing students.

I saw another post where you can remove users by role, but we would not want to create a role for each incoming class. We would rather have one role called “Students”.

Thanks

Yes this can be done. Here’s how I would do it:

Remove the existing students:

  1. First I would go to the standard list of Users by clicking on the People link in the Administration toolbar (black toolbar across the top). 
  2. I would use the Bulk Operations option that is standard as part of Drupal Core; filter by Role (Student for your example) and remove all the students.
    1. Click on the top check box to select all
    2. Select Cancel Selected Users Accounts and click on Update.
    3. Click on the Delete the account and make its content belong to the Anonymous user radio button.
  3. That will remove the previous year’s students. 

Add new students:

  1. Collect a list of the new student NetIDs one on each line.
  2. Select People > Add CAS User(s) from the Administration toolbar.
  3. Paste the NetIDs in the box, be sure they are all one line for each NetID.
  4. Click on Create New Accounts. This will pull their name, email, phone etc. 

You can also create a customized list with Views and the Views Bulk Operations Module. But this is more complex. If you find that the initial instructions aren’t enough, please let us know. There is a really good tutorial on Views Bulk Operations page in the upper right corner that could be helpful.

Thanks, Nancy.

Is it possible to assign a default role to all the users as they are imported?

Unfortunately it is not. When someone logs in they are “authenticated” users, but they are not assigned roles and anyone with a Yale NetID can login. 

Is there a way to filter the list of users, so that only people with no roles are shown?

I would like to import the incoming class each year, without removing the previous year’s class, in case they have made any modifications to their accounts.

Hi Ben, 

I don’t see a way to sort by role, even if you try to create a view. You can only sort by last access, member for and username.