cancel
Showing results for 
Search instead for 
Did you mean: 

How to read user photo from AD to IdM?

Chenyang
Contributor
0 Kudos

Hi,

Is there a way to read the user photo from Microsoft AD into IdM? I tried to setup a step to include the photo attribute in a FromLDAP pass, but I couldn't find the correct datatype - binary.

Thanks,

Chenyang Xiong

Accepted Solutions (1)

Accepted Solutions (1)

former_member201064
Active Participant
0 Kudos

Hello,

I use a Memo field. You get a value like {HEX}ABCFEFG... from which that prefix has to removed further on.

For writing to the Identtiy Store I use a small Java class which simply select all new files and writes them to the file system using a separate folder and the mskeyvalue as filename (). It could also work using uIS_SetValue or a ToIdentityStore pass, but I haven't tried that out.

Best regards

Dominik Trui

Here a small code snippet out of the Java class (without error handling and parameters):

String connectionUrl = jdbcUrl;

Connection con = DriverManager.getConnection(connectionUrl);

byte[] fileBytes;

Statement state = con.createStatement();

ResultSet rs = state.executeQuery(query);

fileBytes = rs.getBytes(1);

String filename = rs.getString(2);

String requestId = rs.getString(3);

OutputStream targetFile = new FileOutputStream(filename);

targetFile.write(fileBytes);

targetFile.close();

Chenyang
Contributor
0 Kudos

Hi Dominic,

Thank you very much for the solution. I was using a IDM 8 system to read photos and didn't find this "MEMO" datatype in FromLDAP pass. I need a IDM 7.2 system to verify the solution.

Thanks,

Chenyang Xiong

former_member201064
Active Participant
0 Kudos

Have you tried text?

Another option would be to create the table once using a nvarchar(max) in MSSQL or CLOB in Oracle for the column (adjust it in the SQL Studio / Developer if needed). Than use "Add entries to table" instead of "Delete entries before loading". You have to use another ToDatabase pass before that pass which simply does a "delete from sapRepNameUser" with SQL updating.

Chenyang
Contributor
0 Kudos

Aha, it is working with the TEXT datatype. I am able to read the picture from AD and dump the data into jpg files now.

It is a bit surprise to me that I can store picture into a TEXT.

Thanks a lot for the support.  Have a great day Dominik!

former_member201064
Active Participant
0 Kudos

The IdM stores anything in the aValue/Searchvalue/aLong column as nvarchar / text though. However, the attributes are interpreted differently if one chooses a different Storage or Presentation.

Answers (0)