To download your Roster from Moodle you will need to go through the Gradebook.
In your course navigate to your gradebook
In the Gradebook go to the Export
Then choose the Excel Spreadsheet This will allow you to easily manipulate the roster if you need to import it into another system.
If you only want the roster, scroll down the list of Grade Items To Be Included, at the bottom of the list select the none If you would like the grades for the assignments keep them selected.
You can ignore the Export Format Options section, and click Download
Save your roster in OneDrive or on your desktop for future access.
This will create an excel with your student roster, including their first and last name, ID number, and email address.