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.

2) Select the users (or use "Select all users" box at the top of the list of names)

3) At the bottom, drop down the Choose.... menu. "Download table data as" option to export the desired file format.