Community Member

How do I get a list of users in a course that does not include folks who have completed the course?

Using Powershell. I can get a list of 851 enrolled users in this course and section:

$result = Invoke-RestMethod -Method GET -uri "" -header $headers -body @{include = "students";enrollment_role_id = 'StudentEnrollment'}

This includes lots of students who have enrollment type "completed" when looking at the GUI for this section.

When I try to refine my search by adding enrollment_state = "completed" to the body, we still get 851 students.

$result = Invoke-RestMethod -Method GET -uri "" -header $headers -body @{include = "students";enrollment_role_id = 'StudentEnrollment';enrollment_state = "active"}


I think I'm missing something about how enrollments work in canvas or how the body works. Any one able to help out with a valid command for returning only active, enrolled users in a course's section?

Labels (2)
0 Kudos