cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
lhenson
Community Contributor

Batch Delete Users not Imported via SIS

We had hackers create accounts in our Canvas environment via public courses so they weren't added via our SIS import.  There are hundreds of them.  Is there any way to do an upload and change the status of their accounts to deleted?  I was able to identify the accounts via the Provisioning Report. I created an import .csv file of the accounts and changed the status to deleted.  The only ID that I had was the Canvas ID, so I plugged that in for the user_id field. When I uploaded it, everything seemed like it worked, but when I double checked to see if the accounts had been removed, they are still in our system, so apparently the import didn't run. Is there any way to get rid of them besides individually?  Like I said, there are hundreds of them and I have already spend days working on this. When I contacted PriorityServicesK12, their response was "Good luck with that." If it can't be done, then it can't be done, but hopefully there is a way to make it happen.

0 Kudos
4 Replies
mzimmerman
Community Champion

If there is no user_id in the provisioning report (equivalent to the "SIS ID" field in the GUI), then the SIS integration feed process has no way of identifying the record, and thus no way to change the settings on it.

I think the only way to do bulk deletions in this case is to use the API.  There is not an API for deleting users, surprisingly, but there is one for deleting logins:  https://canvas.instructure.com/doc/api/logins.html#method.pseudonyms.destroy   I think that you would have to do some scripting to call the login APIs to retrieve and then delete all the logins for the user.

Note, I'm not an expert on scripting by any means, but maybe someone else has some experience with this?

robotcars
Community Champion

@lhenson

That's super frustrating and definitely not an easy task.

First things first. Unfortunately, by using the CanvasID in the SIS CSV import you may have caused yourself some additional work. SIS_ID and CanvasID are different. Every user has a CanvasID /users/#, but that user can also have an SIS_ID and will if created by an SIS or CSV Import. When doing SIS Imports (users.csv) CanvasID and SIS_ID are not interchangeableThis means a couple of things for that import.

Find that import: /api/v1/accounts/self/sis_imports

  • Did you pass all users as 'deleted' for status?
  • Were any users created? You may have created an SIS version of the user you wanted to delete (in a created state), a duplicate. Just verify this for yourself.
  • Using the file you imported, make sure that none of the user_id's with a CanvasID (from your deletion list) actually matches one of your real users SIS_ID's. Make sure you didn't change their name, email, login, and delete them. Restore anyone that broke, if your SIS doesn't automatically restore them regularly. Those users may have lost something when they were deleted.

If that's all cleaned up, then, now you still have a list of users you want to delete, and a possibly an addition of duplicates for them created in a deleted state.

 

 

 

mzimmerman
Community Champion

Thanks for pointing out the correct place for the delete user API!

It's hard to find in that documentation, it needs to be cross linked in Users.