Hi Behan,
Our scenario was the same before. But, may be after we update the Moodle to 3.9.2, all the azure users on O365 azure are appearing on Moodle without even login in for first time. This will help in course enrollment. AD sync task was running everyday 1.30AM. So, by default the next day some students were complaining that they are unable to login. Because the users were disabled.
We can disable the task. But very few users are getting an error while logging to Moodle " No token available for this user". To solve this issue I have to do a full AD sync again. So, now I cannot stop the task completely because of this issue. This is happening with delta sync only. Full sync is ok.
I am copying the 'suspending' log below.
Execute scheduled task: Sync users with Azure AD. (local_o365\task\usersync)
... started 10:05:03. Current memory use 48.2MB.
...... Starting sync
...... No skiptoken (delta) stored.
...... Using deltatoken.
...... Using delta sync.
...... Contacting Azure AD...
...... Got response from Azure AD
...... Storing deltatoken
...... Clearing skiptoken (delta) (none received)
...... No users received to sync.
...... Checking deleted users list...
......... Could not find user s201810001@mcm.ac.ae in Azure AD. Suspending user...
......... Could not find user s201810002@mcm.ac.ae in Azure AD. Suspending user...
......... Could not find user s201810003@mcm.ac.ae in Azure AD. Suspending user...
......... Could not find user s201720018@mcm.ac.ae in Azure AD.
Deleting log:
......... Could not find suspended user s201810002@mcm.ac.ae in Azure AD. Deleting user...
......... Could not find suspended user s201810003@mcm.ac.ae in Azure AD. Deleting user...
......... Could not find suspended user s201720018@mcm.ac.ae in Azure AD. Deleting user...
......... Could not find suspended user s201810009@mcm.ac.ae in Azure AD. Deleting user...
......... Could not find suspended user s201810010@mcm.ac.ae in Azure AD. Deleting user...
......... Could not find suspended user s201810014@mcm.ac.ae in Azure AD. Deleting user...
......... Could not find suspended user s201810015@mcm.ac.ae in Azure AD. Deleting user...
......... Could not find suspended user s201810011@mcm.ac.ae in Azure AD. Deleting user...
...... Sync process finished.