o365-moodle
o365-moodle copied to clipboard
Feature request - allow resync team owners / members per course, from the manage course connections page
Running Moodle 3.9.9 with local_o365 plugin 3.9.6.
We're experiencing an issue where a connected Team is not having all the users with the necessary capabilities being added to the respective Teams group.
We use Get-TeamUser to verify Teams group membership and we can see that (even after a whole weekend) not all the users are added to the Teams group even though the Moodle course is connected to a Teams group.
We have verified this by removing and immediately re-applying the 'Student' role for a student. Within a matter of seconds, when we run Get-TeamUser, we can see the student has successfully been added to the teams group.
We wondered whether we had triggered any throttling, as we're beginning to quite heavily use the Teams integrations with our courses (we are asked to connect between 5 and 30 courses a day - by connect we mean the majority of requests are to get Moodle to create the Teams group for the course and then add the members), however even after waiting an entire weekend the group membership hasn't changed.
This isn't happening to all Teams groups, however we were wondering if there is a way to re-trigger the user sync portion for an entire Moodle course so that we don't have to do such tasks as hiding/unhiding the course or turning off Teams sync within the Teams Sync admin screen for the specific course in question?
Hi @kinnectus,
I can confirm that there isn't an existing feature to re-sync group/team owners/members of courses that are already connected. This is mainly because there hasn't been many reporting of the issue. An admin tool to do it is quite feasible though.
Also I can confirm that the existing integration implementation has very little consideration on throttling, but the scale of use in your description isn't likely to cause throttling issues - we have seen much heavier use without triggering throttling.
Back to your particular case, I'm wondering, when you "removing and immediately re-applying the 'Student' role" of a user and saw the user being added to the group/team, was that user in the team/group before your action? Could you also confirm the number of users in the course at the time of initial sync please.
Regards, Lai
Hi Lai,
Please ignore the portion regarding unticking and re-ticking a Teams group connection. We have worked out that this disconnects and soft deletes the Teams group.
Returning to our original issue:
We have identified that due to the plug-in hooking into the course enrollment events (create, update, delete) to trigger the user amendments into the course Teams groups is why we're seeing this happen when we remove/re-add a role with Teams capability.
What we noticed - hence the request for a re-processing tool - is a side effect of us using Moodle web services to create users and those users not having mdl_local_o365_object entries when a Teams group is created. The user is created in Moodle and enrolled on their relevant courses (with Student role). We then receive complaints from the module leader saying their Teams group membership doesn't match Moodle. This is due to the user not having an o365 object.
We incorrectly assumed that by asking the students to log in (to create their o365 object) would then synchronise them to the Teams group. When this didn't happen we dug a little deeper to find the triggers are the events above.
A sync tool would allow us to essentially re-run the Teams group connection but only process the user sync portion. Much like when you "update" an existing Teams group connection to another group. We already look at the o365 objects table to verify all the users enrolled on a course have o365 objects. We report back to the module leader who can't be synced and that when the students signs in we can manually fix the issue (by removing/re-adding student role).
A potentially useful addition, is if there is an event that triggers upon a user logging in and their auth type 'oidc', would be to trigger the user being added to all Teams groups associated with their profile, if their courses are Teams group connected. This may have some performance hit, I should imagine, so isn't critical.
Best wishes,
Chris
Get Outlook for Androidhttps://aka.ms/ghei36
From: Lai Wei @.> Sent: Monday, October 4, 2021 5:36:37 PM To: microsoft/o365-moodle @.> Cc: Chris Loweth @.>; Mention @.> Subject: Re: [microsoft/o365-moodle] Not all users with correct capabilities being added to Teams group (#1819)
Hi @kinnectushttps://github.com/kinnectus,
I can confirm that there isn't an existing feature to re-sync group/team owners/members of courses that are already connected. This is mainly because there hasn't been many reporting of the issue. An admin tool to do it is quite feasible though.
Also I can confirm that the existing integration implementation has very little consideration on throttling, but the scale of use in your description isn't likely to cause throttling issues - we have seen much heavier use without triggering throttling.
Back to your particular case, I'm wondering, when you "removing and immediately re-applying the 'Student' role" of a user and saw the user being added to the group/team, was that user in the team/group before your action? Could you also confirm the number of users in the course at the time of initial sync please.
Regards, Lai
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/microsoft/o365-moodle/issues/1819#issuecomment-933656952, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AM4NUPLU7CIGK6CNSUVL3R3UFHJZLANCNFSM5EMCKV2Q. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Hi @kinnectus,
There is actually a tool in the plugin that you can use to re-sync group owners and members. It's located in the "Advanced" tab of the configuration page, in the "View maintenance tools" section, and it's the first tool on that page "Resync users in Microsoft 365 groups for courses".
Please give it a try.
Regards, Lai
I found the tool, however it seems to be a 'mass re-syncing' tool, rather than having any granular ability to re-sync a single, group or all courses to their respective Teams group(s). It also has a major warning "If you have added any additional users to a course group that are not enrolled in the associated Moodle course, they will be removed.". This could be problematic if all one needed to do was re-sync a single Moodle course to its respective Teams group. You'd essentially re-sync every single linked Team in Moodle, causing chaos to those teams where an owner had added one or more users, outside of Moodle. I think the tool is quite dangerous for large (or small) environments and should be used with extreme caution.
It would he handy to have on the "Manage Team Connections" page a link to re-sync a single Team. You can already "Update" an existing linked course (i.e. if you wanted to change the Team the Moodle course links to). Having a link in the "Actions" column to re-sync the currently linked Team would be fairly easy to implement as it could partially re-use the code for the maintenance tool you've mentioned. I'd probably suggest a page the user is taken to where they can choose what kind of resync the course requires - "re-sync Moodle users but don't remove others in Teams group" and "re-sync Moodle users and remove others in Teams group (reset)"

Hi @kinnectus,
This is a quite reasonable feature request, and feasible too.
I have updated the title of the issue and applied the relevant tags. We will process this accordingly.
Regards, Lai