1. Kayako Download customers: we will continue to develop and support Kayako Download beyond July 2017, alongside the new Kayako for existing customers.

    Find out more.

  2. The forum you are viewing relates to Kayako Classic. If you signed up or upgraded to the new Kayako (after the 4th July 2016), the information in this thread may not apply to you. You can visit the forums for the new Kayako here.

Active Directory User Sync Script

Discussion in 'Apps and modifications' started by Dylan Lindgren, Aug 26, 2009.

  1. Soporte 2

    Soporte 2 New Member

    I have configured the plugin, what happens if I change the domain that we are using? Users will be the same and have the same mails.
  2. ds289

    ds289 Established Member

    Nothing - should continue to work fine.
  3. Soporte 2

    Soporte 2 New Member

    But if the users have the same email configured in Active Directory, Kayako do not show duplicate users?
  4. ds289

    ds289 Established Member

    As long as e-mail addresses are not changing, you should not get dupes. Presumably you are only modifying the search DN and/or LDAP host in this case.

    From the code comments:

    // We are using email addresses to compare the users. Sometimes the emails are capitalised etc, so lets convert it to lowercase to ensure the comparison works.
    Which is followed by code that shows it comparing e-mail addresses retrieved from the AD query to what already exists in Fusion so it can either Update, Insert, or Disable the user.

    Even if the e-mail addresses were changing, you could schedule some brief downtime, run a SQL command to mass update the domain part of the e-mail addresses in the user table to avoid dupes on the next sync.
  5. Derek Vance

    Derek Vance New Member

    Are there any plans to update this script? I noticed that you require a dated version of the API SDK. I am getting all kinds of cURL errors because of the newer streams being used. Currently I am getting this:

    E:\WWW\kayako>"C:\Program Files (x86)\PHP\v5.3\php.exe" ADUserSync.php
    There were no results pulled from the AD query. Nothing has been imported.Disabl
    ing 0 of 1 - Brenda Utters.........PHP Warning:  curl_setopt_array(): cannot rep
    resent a stream of type MEMORY as a STDIO FILE* in E:\WWW\kayako\KayakoAPI\kyBas
    e.php on line 190
    PHP Fatal error:  Uncaught exception 'Exception' with message 'HTTP error: 401'
    in E:\WWW\kayako\KayakoAPI\kyBase.php:198
    Stack trace:
    #0 E:\WWW\kayako\KayakoAPI\kyBase.php(246): kyBase::processRequest('/Base/User',
    'PUT', Array, Array)
    #1 E:\WWW\kayako\KayakoAPI\kyObjectBase.php(171): kyBase::_put(Array, Array)
    #2 E:\WWW\kayako\ADUserSync.php(189): kyObjectBase->update()
    #3 {main}
      thrown in E:\WWW\kayako\KayakoAPI\kyBase.php on line 198
  6. Derek Vance

    Derek Vance New Member

    I figured out the issue, But I ended up having more issues. I ended up just writing a new script entirely.
  7. Zak Lewis

    Zak Lewis New Member

    Can you please share the script, I'm having the exact same issue.
  8. ds289

    ds289 Established Member

    So, am I to gather from this that the script will no longer work with newer versions of Fusion since newer versions of it require the newer API SDK?

    We are on 4.54, but wanting to upgrade and all these 3rd party things that don't see updates are cause for concern.
  9. NightFire

    NightFire New Member

    I can confirm that this script does work using version 4.72.0 and the latest PHP API. You will need to change the line about KyBase as mentioned on a previous post:
    kyConfig::set(new kyConfig($kayakoApiURL, $kayakoApiKey, $kayakoSecret));
    Also I found using this filter works well:
    If it would help to post my modified script I can do that also. The AD I am using is 2008 R2. Our organization isn't large and as stated in a previous post there could be issues with a large sync of over 1000.

Share This Page