There are two ways to run an individual scheduled task:
- Click Run now for LDAP users sync job on the Site administration → Server → Scheduled tasks page. You need to set Path to PHP CLI in Site administration → Server → System paths if this link doesn't appear.
- From the command line. On Linux this would be something like php /path/to/moodle/admin/tool/task/cli/schedule_task.php --execute=\\auth_ldap\\task\\sync_task
Using the second option you can capture the output, e.g. php /path/to/moodle/admin/tool/task/cli/schedule_task.php --execute=\\auth_ldap\\task\\sync_task > /tmp/output.txt 2>&1 to send it to /tmp/output.txt.