We recommend reviewing what is submitted before posting, in case your idea has already been submitted by another community member. If it has been submitted, vote for that existing feature request (by clicking the up arrow) to increase its opportunity of being added to Cireson solutions.
For more information around feature requests in the Cireson Community click here.
ability to show AD thumbnail photo on Cireson Portal of affected user
Hello
We are working in a big company with more than 1000 users.
Sometimes it would be useful to have a photo of an enduser in the "affected user"-area, to better recognize them in large offices.
We've already imported those AD thumbnail photos, so they also appear in Outlook / Skype for Business.
Would that be a big task?
Thanks and best regards
Silas
Comments
Using the CustomSpace directory, you create/append HTML tags on the fly based on the presence of the Affected User on a Work item. If it exists, you'll need to pull the image content (I think in AD its stored as a Byte Array. Not sure how/if this translates) and get it into a base64 string format. Then you can dynamically append an HTML image tag with said base64 string to anywhere you want on the page.
<img src="data:image/png;base64,USERBASE64IMAGESTRINGHERE" />
Conceivably, you could extend your user class with this property (probably as a string data type, making sure to make it big enough) and then sync it with AD.
But to @Adam_Dzyacky's point, you would then need to convert it when displaying. Each byte is a 2-character representation of an octet, divided by the "\" character each time. For example, a byte could be 0x00 in hex, and would simply be 00 in this format. Two bytes of 00 and FF would appear as \00\FF\ in this format. I am not immediately certain how to convert this to Base64, but it seems like it would be very feasible.
However what @Tom_Hendricks is saying is also entirely correct. If you were to open up ADSI and look at a user's thumbnailPhoto property, you would see the identical format he describes (i.e. "\00\FF\....") of type Hexidecimal. They are the same exact values, just represented differently.
So to get that user property into a base64 in PowerShell we can simply do:
I took the output of this, dropped it into the aforementioned image tag in a dummy HTML file and can verify it renders correctly. Perhaps the only real distinction worth making here is I'm using ThumbnailPhoto and Tom is pointing out the Photo attribute. Both valid properties on an Active Directory User object!
So now I'm thinking (in the same way Tom is. What a surprise )...a class extension on the User class for a "base64imageString", the import/export process performs the aforementioned conversion, and then via CustomSpace you pull this value since Cireson honors class extensions.
If you already imported the photos so they appear in Outlook and you use Exchange as mail server you could utilize EWS and retrieve the user photo from there. Simply get the photo from the following url:
https://www.contoso.com/ews/exchange.asmx/s/GetUserPhoto?email=user@contoso.com&size=HR240x240
More info here: How to: Get user photos by using EWS in Exchange
Btw, really like the idea so if someone has the time please share your solution!
Basically we currently pass the userpicker ID from the form, and the GUID of the entered user when the user picker changes, then insert HTML below it for the data we want displayed. you can see the inserted <img> tag below (although the web address has been changed)
Many thanks to all of you! I'm really overwhelmed by all of your effort!
I think to use the EWS solution would be easiest way for me.
The posted code from @Jeff_Lang helps me a lot too.
Where did you place that code, that it appears in the correct div right below the selected user?
Did you do that by placing that code in "CustomSpace"-area and calling it from "custom.js"?
Thanks so much!
I just got the ok from @Adrian_Paech to upload the file i am using (It's a modified version of a file i got from him).
it's in the community uploads section at https://community.cireson.com/discussion/3214/display-customer-information-and-image-from-ews-below-user-name#latest