|
Edit the configuration array at the beginning of the script to tailor it to your needs:
// Configuration of the Active Directory connection
'host' => 'localhost', // IP or FQDN of your domain controller
'port' => '389', // LDAP port, 398=LDAP, 636= LDAPS
'dn' => 'DC=combodo,DC=net', // Domain DN
'username' => 'ad_user', // username with read access
'password' => 'ad_password', // password for above
// Query to retrieve and filter the users from AD
// Example: retrieve all users from the AD Group "iTop Users"
'ldap_query' => '(&(objectCategory=user)(memberOf=CN=iTop Users,CN=Users,DC=combodo,DC=net))',
// Example 2: retrieves ALL the users from AD
// 'ldap_query' => '(&(objectCategory=user))', // Retrieve all users
// Which field to use as the iTop login samaccountname or userprincipalname ?
'login' => 'samaccountname',
//'login' => 'userprincipalname',
running the script
The script can be run only by an iTop administrator.
When your configuration is done, run the script either by pointing your web browser to it
(h r/webservices/AD_import_accounts.php) or by using the following
command line:
php.exe -q AD_import_accounts.php --auth_user=<iTop_admin_user> --auth_pwd=<iTop_admin_pwd> |
|