local_o365\task\usersync : Microsoft 365 not configured

local_o365\task\usersync : Microsoft 365 not configured

by Arnaud Forster -
Number of replies: 1
Hello all,
I linked our Moodle to Microsoft 365 and people can connect to Moodle using their Microsoft 365 credentials.

I then tried to sync existing moodle users to the Microsoft 365 acccounts but when running the task I get the following error :
Microsoft 365 not configured

When installing the Office 365 plugins, I took the opportunity to change the name of our domain (the name of our school changed) from moodle.gfbienne.ch -> moodle.gbjb.ch and changed my moodle config.php file to this :



According to the Notifications of my Admin page, I'm using the following version


But, when I get a phpinfo() my old domain name remain at some places but I dont know if this can be the cause of the 'Microsoft 365 not configured' message :

My Moodle






Finaly, when I tried to have a look to my sync task , I get the following infos :

1. the hostname is stil moodle.gfbienne.ch instead of moodle.gbjb.ch



2. The task returns the following error
Execute scheduled task: Synchronisez les utilisateurs avec Azure AD. (local_o365\task\usersync)
... started 16:40:01. Current memory use 7.2 Mo.
...... Microsoft 365 not configured
... used 0 dbqueries
... used 0.00048708915710449 seconds
Scheduled task complete: Synchronisez les utilisateurs avec Azure AD. (local_o365\task\usersync)

I dont know where to change this moodle.gfbienne.ch to moodle.gbjb.ch and if this is the cause of the message 'Office 365 not configured'.

As a reminder : new uses can connect using their Microsoft 365 credentials


Thanks to all for your help

Best Regards





Average of ratings: -
In reply to Arnaud Forster

Re: local_o365\task\usersync : Microsoft 365 not configured

by Anton Tremetzberger -
Picture of Particularly helpful Moodlers
Hi Arnaud,

I haven't had the error yet, but have you tried the following things (we are using version 4.1, but I think it is similar in version 4.3)?

In the plugin settings for Microsoft 365 Integration / Advanced / Maintenance Tool
- Run Health Check --> do you get an error there?
- Run "Cleanup User Sync Delta Tokens"

In the plugin settings for Microsoft 365 Integration / Sync Settings
- Change the synchronization from Delta Sync to Full Sync (if you don't already have it) and try to run the sync again

In the plugin settings for Microsoft 365 integration / Setup
- which URL do you have in Step 1/3?
- you can run the admin consent again (Run "Provide Admin Consent")

In the scheduled tasks, execute the task "\local_o365\task\refreshsystemrefreshtoken"

I hope that these tips will help you. There is also a developer forum on github (https://github.com/microsoft/o365-moodle/issues) maybe they can also help you.

br, Anton