#LDAPRecord Scheduled Import

1 messages · Page 1 of 1 (latest)

sand copper
#

I have LDAPRecord set up and running as needed to import user account information (not for authentication). I want to schedule the import but can't get the code correct. I am running Laravel 11 and Filament. Below is the code that I have set as an action for a button, which works fine. I tried using this in console.php but it failed. I have also tried different iterations and either get a failure or it doesn't import.

Artisan::call('ldap:import', [
'provider' => 'domainusers',
'--no-interaction',
'--restore' => true,
'--delete' => true,
'--delete-missing' => true,
'--filter' => '(objectclass=user)'
]);

craggy lion
#
$schedule
    ->command('ldap:import users --chunk=100 --no-interaction')
    ->name('ldap-import')
    ->onOneServer()
    ->dailyAt('01:00'); 
#

That's ldaprecord 2.5 on laravel 10, but I think it should work on later versions as well