The Class Roster can be exported from Participants list in Moodle:
1) Log into Moodle and go to the course you want the roster for. At the top of the page under the header (the Navigation Bar) you will see "This course" -> "Participants"
Click on Participants and a class roster will appear.
The Class Roster can be exported in a variety of formats if necessary.
2) Select the users (or use "Select all users" button box at the top of the bottom of page) and then use the "With Selected Users" dropdown menu list of names)
3) At the bottom, drop down the Choose.... menu. "Download table data as" option . to export the desired file format.