microsoft / o365-moodle

Office 365 and Azure Active Directory plugins for Moodle
GNU General Public License v3.0
180 stars 136 forks source link

User Sync doesn't sync all the users #2390

Open OsaABD opened 11 months ago

OsaABD commented 11 months ago

Hi, thank you for all the efforts to integrate teams with Moodle First, we have Moodle 4.1 and installed and updated the necessary MS temas plugin. We are using both external DB and OpenID authentication as follows: We use the external DB to sync all the users from the registration system using OpenID, the plugin automatically switches users from external auth to OpenID authentication in Moodle.

Everything seems to be working fine, teams are being created, and users are being enrolled in their respective teams (with the right permissions)

but we noticed that (for example) course "ABC" has 50 participants in Moodle. When we checked for it in the MS Teams Admin panel, We saw that there is a Team Called "ABC" that exists BUT with 37 participants (members) only.

I am wondering why isn't the rest of the students haven't synced.

we run these tasks regularly: 1.Sync users with Azure AD 2.Sync Moodle courses to Microsoft Teams

weilai-irl commented 8 months ago

Hi @OsaABD

Let me briefly explain the teams member sync workflow - when running a teams sync task from a Moodle course, when handling team ownership / membership sync, here's what happens:

Note that this logic only applies when creating teams integration from a Moodle course. If a Moodle user is only mapped after teams integration is created a Moodle course, the user will not be re-added to team. However, any future changes to the user's enrolment in the Moodle course will be synced to the team, e.g. if the Moodle user is enrolled from the course, Moodle will try to remove the user's teams ownership/membership, even if the Microsoft user is not part of the team; and if the Moodle user is enrolled back to the course again, Moodle will try to add the Microsoft user to the team.

Hope this explains what you saw.

Regards, Lai