Active Directory User Photo Integration

 

 

Photo Storage Background

 

Hyena allows displaying a photo for user-type objects on the User Properties->Personal dialog. By default, Hyena will store and retrieve the image information from the 'thumbnailPhoto' AD attribute. Windows 2003 introduced a new attribute named 'jpegPhoto'. Using the Advanced Settings (see below) under Tools->Settings, you can change which attribute is used to store photo image information.

 

Both of the 'jpegphoto' and 'thumbnailphoto' attributes in AD are binary data types. Therefore, the actual binary data of the image is stored into the directory : not the path or pointer to the original photo file. There also isn't any restriction on what type of information can be stored into either attribute. Both attributes will accept any data, including .gif or .png files, for example. Its possible that some applications might expect a file in a particular format, but that is entirely arbitrary. From the standpoint of AD, these attributes are just containers for binary data. This is also true of Hyena or any application reading this information: There isn't any reasonable way to know what image format the data is in.

 

What Hyena does when retrieving either attribute (depending on the setting of the 'AdPhotoAttributeName' setting; see below), is to write the binary data into a temporary file. This file is written to the "<user's profile>\local settings\temp" directory and given a file name starting with 'hy_' and with a .tmp extension. This file is then used on the user properties 'Personal' dialog. Hyena does not actually perform the display of the graphic image contained in this file, but rather its controlled and displayed by Windows. Windows appears to support displaying .bmp, .gif, .jpg, .ico, and .png files and possibly others. Verify that these images can be displayed on your client computers using Hyena before settling on a particular image format. Since the binary data in the file is actually stored in Active Directory, its important for directory performance reasons to try to keep the originating file sizes as small as possible.

 

When enabling the View' option on the User Properties->Personal dialog (see discussion below), one potential problem is that Hyena has no way of knowing what type of image file is being stored in the directory and therefore just places a .tmp for the temporary file extension. If you use the '%WINDOWS_DEFAULT%' setting for the view command, Windows will usually not know what to do with .tmp files and an error will result. One workaround is to associate .tmp files with your graphics application. Alternately, you can specify a specific application to run, but just remember that the file will still have a .tmp extension and the application may need to be configured accordingly. The Microsoft Paint application (mspaint.exe) does not appear to have any problems displaying any graphics file with a .tmp file extension. This is the reason that the View button is not displayed by default in the User Properties->Personal dialog, as the methods of viewing of the graphics files needs to be understood first.

 

Advanced Options

 

 

Specifying the Photo Attribute

 

To specify the attribute to use for storage of user photos in Active Directory, select Tools->Settings->Advanced and modify the setting named "AdPhotoAttributeName". By default, the 'thumbnailPhoto' attribute is used.

 

Viewing Photos

 

To enable the option to view the photo using a tool of your choice, select Tools->Settings->Advanced and modify the setting named "AdObjectPhotoViewCmd". You can set the value to one of the following:

 

%WINDOWS_DEFAULT% - This value will simply cause the default Windows application to run when the View option is selected.

 

<User-Specified> - Alternately, you can specify the command to execute, using %E% for a placeholder for the image file. For example, to run the standard Windows Paint application, specify the command of:

 

Mspaint "%E%"

 

The quotes will usually be needed because of long file names and spaces. You can use any application as long as you know its command line syntax.

 

A 'View' button will only appear if you have set the 'AdObjectPhotoViewCmd' registry setting.