Now that LDAP/Active Directory reader have been put on the deprecation list in FME 2023, I'm trying to find an out of the box solution in FME to update my workbenches and continue using it.
Now that LDAP/Active Directory reader have been put on the deprecation list in FME 2023, I'm trying to find an out of the box solution in FME to update my workbenches and continue using it.
Best answer by jalary
I was able to use python librairy ldap3 to connect and retreive data. Also exporting the result in JSON format.
import json
import fme
import fmeobjects
import ldap3
class FeatureProcessor(object):
def input(self, feature: fmeobjects.FMEFeature):
server = ldap3.Server(feature.getAttribute('server'))
# username and password from parameter
conn = ldap3.Connection(server, FME_MacroValues['username'], FME_MacroValues['password'])
conn.bind()
# scope attribute
conn.search(feature.getAttribute('scope'), f'(objectClass=person)', attributes=['*'])
# to a JSON object
ad_data = conn.entries
ad_data_json = [str(entry.entry_to_json()) for entry in ad_data]
feature.setAttribute("ad_data_json",ad_data_json)
self.pyoutput(feature)
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.