I would need a PHP script which meets the following requirements:
-Sync Windows Active Directory (LDAP) with data from MySQL database (1 way sync from MySQL -> LDAP).
-The users are in the MySQL DB and Active Directory (LDAP), the foreign key is the employee ID .
-There are 3 fields to be synchronized: phone, mobile, e-mail.
-If the user exists in LDAP, update the 3 fields, if it doesn't exist write to a log file which users didn't exist.
-I need to be able to target different LDAP groups (Organizational Unit in Active Directory), e.g I need to be able to specify multiple base-DNs for the LDAP users which need to be synchronized.
-There should be an option to define multiple LDAP servers, in case the first one is not reachable.
-This script will run on a Windows Server every hour using a scheduled task.
-If there is any error, the script should send out an error notification mail to a specified e-mail address.
-The script should be well commented/documented.