GLPI automatic synchronization with LDAP
First in the GLPI setup.
[Find the location of the ldap_mass_sync.php script file]
[root@hghast001 etc]# find / -iname *ldap_mass_sync.php*
/var/www/html/glpi/scripts/ldap_mass_sync.php
[See instructions for using ldap_mass_sync.php scripts]
[root@nb0001 ~]# php /var/www/html/glpi1/scripts/ldap_mass_sync.php --help
Usage: php -q -f ldap_mass_sync.php [action=<option>] [ldapservers_id=ID]
Options values:
0: import users only
1: synchronize existing users only
2: import & synchronize users
before-days: restrict user import or synchronization to the last x days
after-days: restrict user import or synchronization until the last x days
ldap_filter: ldap filter to use for the search. Value must be surrounded by ""
[Ldap_mass_sync.php Add Users]
[root@nb0001 ~]# php -q -f /var/www/html/glpi1/scripts/ldap_mass_sync.php action=0
Processing LDAP Server: glpi, ID: 1
...................................
Imported: 35
Synchronized: 0
Deleted from LDAP: 0
[Add and Sync]will disabled the name of the departing person
[root@nb0001 ~]# php -q -f /var/www/html/glpi1/scripts/ldap_mass_sync.php action=2
Processing LDAP Server: glpi, ID: 1
...............................................................
Imported: 0
Synchronized: 236
Deleted from LDAP: 34
[Auto sync per hour]
[root@hghast001 etc]# vim /etc/crontab
1 * * * * /usr/bin/php -q -f /usr/bin/php -q -f /var/www/html/glpi/scripts/ldap_mass_sync.php action=2 >> /dev/null 2>&1
Complete
This article comes from "Life is endless, tossing and turning." "blog, declined reprint!"
GLPI automatic synchronization with LDAP "original"