As Canvas Admin how can I delete all users associated with a specific course. I'd like to delete the user from Canvas entirely.
You would want to run the "SIS Export" under the "Reports" tab in the admin settings page. Select "Enrollments CSV" and "Users CSV" for the options to generate the report.
In the Enrollments.csv, you will want to look at the "course_id" column (you will need to know the SIS code for the course). You can add a filter to the spreadsheet to filter out for only the course(s) for which you're looking. That will give you the entire roster of users for that course.
In the Users.csv, delete all of the entries except for the ones that you've filtered out of the enrollments.csv file. Change the "status" column to "deleted" for all of them. Save the file as a CSV (Excel can do weird things with CSV -- our SIS IDs have leading 0s so I have to deal with that -- so you might end up having to copy and paste into a Google Sheet or you may not have to). Then upload your saved users.csv using the SIS Import. Heres' the guide on that: What are SIS Imports? Make sure you do not select full batch update. I leave those optional checkboxes all unchecked.
Here's an additional guide on formatting for CSV uploads: How do I format CSV text files for uploading SIS data into a Canvas account?
I would save that users.csv file somewhere because if you need to access those accounts at some point in the future, you can simply change the "status" column to "active" and re-upload the csv file and the user's information will be there once again with all of his or her data.
I hope your course isn't huge and/or you don't have a large list of users in your system or this could take a while. I'm not versed in API so I can't be much help on that end. If there's a way to do it via API that could potentially be less time consuming.
Hello Matt McLean...
If you don't have a lot of users to delete, the quickest way might be to just manually remove the ones you need to delete. You can do this using this Canvas Guide: How do I delete a user from an account?. If you have multiple users to delete, then there are other ways through API/SIS import to do this, but my knowledge of actually *how* to do this isn't stellar...as I don't do a lot of behind-the-scenes programming or SIS integration stuff with Canvas at our Technical College. If anyone else can help Matt with that part, that would be awesome!
Hope this helps, Matt!
Hey Matt, I've marked Chris Hofer's response with the "Correct Answer" designation. Even so, I've also shared this question with the Canvas Admins group to see if they can offer solutions from the API/SIS perspective.
Retrieving data ...