How can I bulk-assign system roles to existing moodle accounts?

How can I bulk-assign system roles to existing moodle accounts?

by Matthew Willis -
Number of replies: 2

Hi there!

We have a Moodle site that we need to bulk assign existing LDAP users a system role. Our users are enrolled via SOAP UI messages from our enrolment platform. I've got a spreadsheet of over 1000 employees (email address and full name) to update, but I cannot confirm if all have logged into the system (to create the local account in Moodle). I am aware that Moodle has a bulk edit feature, but I don't want to use this in case it creates manual Moodle accounts for users it cannot locate, as this won't connect the Moodle account via LDAP and with the SOAP UI messages coming through.

With this in mind, how can I bulk update these users with the system role required?

Average of ratings: -
In reply to Matthew Willis

Re: How can I bulk-assign system roles to existing moodle accounts?

by Randy Thornton -
Picture of Documentation writers
You can do this using the standard Upload users tool and assign them any system level role you have created. Details are here: https://docs.moodle.org/38/en/Upload_users#Set_system_roles.

Just be sure to use the shortname of the custom role you have created, and when you do the upload, set the type of processing to "Update existing users only" since this is LDAP and the accounts already exist.
In reply to Randy Thornton

Re: How can I bulk-assign system roles to existing moodle accounts?

by Matthew Willis -

>> Just be sure to use the shortname of the custom role you have created, and when you do the upload, set the type of processing to "Update existing users only" since this is LDAP and the accounts already exist.

Ahh, that's the bit of information I was missing. Thank you!