<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Importing user picture ressource from AD using OLE DB Provider for Microsoft Directory Services in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Importing-user-picture-ressource-from-AD-using-OLE-DB-Provider/m-p/616341#M681769</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the reply.&lt;/P&gt;&lt;P&gt;I did not pursue this topic any further, but I do think it's a limitation of the AD / OLE DB provider for Microsoft Directory Services.&lt;/P&gt;&lt;P&gt;Unfortunately I have no clue as to how this limitation can be circumvented.&lt;/P&gt;&lt;P&gt;Maybe by loading parts of the data in a loop and concatenate afterwards.&lt;/P&gt;&lt;P&gt;There are posts that describe loading other AD account information in a loop because of those limitations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If someone found a solution, I would be interested in learning from it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Jan 2015 23:51:41 GMT</pubDate>
    <dc:creator>MarcoWedel</dc:creator>
    <dc:date>2015-01-22T23:51:41Z</dc:date>
    <item>
      <title>Importing user picture ressource from AD using OLE DB Provider for Microsoft Directory Services</title>
      <link>https://community.qlik.com/t5/QlikView/Importing-user-picture-ressource-from-AD-using-OLE-DB-Provider/m-p/616338#M681766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I recently tried to import user pictures from Microsoft Active Directory to personalize a QV application (logged on users should see their AD picture).&lt;/P&gt;&lt;P&gt;While doing so, I encountered a problem importing and converting the thumbnailPhoto active directory attribute.&lt;/P&gt;&lt;P&gt;ThumbnailPhoto in this case contains a user picture (JPG) coded as an octet string.&lt;/P&gt;&lt;P&gt;Unlike the expected string length of some kB I only got a string length of 511bytes leading to a corrupt jpg file as most of the information was missing.&lt;/P&gt;&lt;P&gt;Nevertheless I tried to import this picture stub and decided to work on the string length issue later on.&lt;/P&gt;&lt;P&gt;As I could not load the picture ressource directly from the string, I previously saved it to disk.&lt;/P&gt;&lt;P&gt;The conversion and saving was done using vbs.&lt;/P&gt;&lt;P&gt;Here are the load script and vbs function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;OLEDB CONNECT32 TO [Provider=ADsDSOObject;Encrypt Password=False;Integrated Security=SSPI;Data Source=&amp;lt;ADserverName&amp;gt;;Mode=Read;Bind Flags=0;ADSI Flag=-2147483648];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;tabADPhoto:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;SQL select&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp; SN,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp; givenName,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; sAMAccountName,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; thumbnailPhoto&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;from 'LDAP://&amp;lt;domainname&amp;gt;.com' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;where &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; sAMAccountName = '&amp;lt;useraccount&amp;gt;';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;Left Join&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;LOAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; sAMAccountName,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; len(thumbnailPhoto) as LenThumbnailPhoto&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;Resident tabADPhoto;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;tabTemp:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; line-height: 1.5em;"&gt;LOAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp; sAMAccountName,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; OctetStringToFile(thumbnailPhoto, 'U:\Qlikview\'&amp;amp;sAMAccountName&amp;amp;'.jpg') as ResultOctetStringToFile&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;Resident tabADPhoto;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;Bundle Info LOAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; sAMAccountName,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; 'U:\Qlikview\'&amp;amp;sAMAccountName&amp;amp;'.jpg'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;Resident tabADPhoto;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;Function OctetStringToFile(OctetString, FilePath) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt; Const adTypeText = 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt; Const adSaveCreateOverWrite = 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt; LenData = Len(OctetString)\2 + Len(OctetString) Mod 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt; set fso = createobject("scripting.filesystemobject")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt; set stream = createobject("adodb.stream")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt; stream.type = adTypeText&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt; stream.charset = "windows-1252"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt; stream.open&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt; For i = 0 to LenData-1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; stream.writetext chr(CByte("&amp;amp;h" &amp;amp; Mid(OctetString, i*2+1, 2)))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt; Next&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt; stream.savetofile FilePath, adSaveCreateOverWrite&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt; stream.close&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt; OctetStringToFile = "processed" &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;End Function&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="54579" alt="QlikCommunity_Thread_UserPics AD_Pic1.JPG.jpg" class="jive-image" src="/legacyfs/online/54579_QlikCommunity_Thread_UserPics AD_Pic1.JPG.jpg" style="width: 620px; height: 56px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="54580" alt="QlikCommunity_Thread_UserPics AD_Pic2.JPG.jpg" class="jive-image" src="/legacyfs/online/54580_QlikCommunity_Thread_UserPics AD_Pic2.JPG.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas as to why the thumbnailPhoto attribute octet string is truncated or whether there is a more straight forward approach for this picture ressource import?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Mar 2014 02:25:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Importing-user-picture-ressource-from-AD-using-OLE-DB-Provider/m-p/616338#M681766</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-03-09T02:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: Importing user picture ressource from AD using OLE DB Provider for Microsoft Directory Services</title>
      <link>https://community.qlik.com/t5/QlikView/Importing-user-picture-ressource-from-AD-using-OLE-DB-Provider/m-p/616339#M681767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anybody?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Mar 2014 22:37:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Importing-user-picture-ressource-from-AD-using-OLE-DB-Provider/m-p/616339#M681767</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-03-16T22:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: Importing user picture ressource from AD using OLE DB Provider for Microsoft Directory Services</title>
      <link>https://community.qlik.com/t5/QlikView/Importing-user-picture-ressource-from-AD-using-OLE-DB-Provider/m-p/616340#M681768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to do the same. I thought it may be similar to the limit of number of users you can get at one time, but looking at the pictures I &lt;EM&gt;did&lt;/EM&gt; get they're all 4kb or 0kb (Blank). Some are full pictures though, so it must depend on the image size to begin with. Here's a comparison...note the resolution and sizes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's mine...&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="76040" alt="johnca.jpg" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/76040_johnca.jpg" style="height: auto;" /&gt;Size on disk: 4.00 KB (4,096 bytes)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And here's another...&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="76041" alt="c_nroman.jpg" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/76041_c_nroman.jpg" style="height: auto;" /&gt;Size on disk: 4.00 KB (4,096 bytes)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2015 23:34:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Importing-user-picture-ressource-from-AD-using-OLE-DB-Provider/m-p/616340#M681768</guid>
      <dc:creator>johnca</dc:creator>
      <dc:date>2015-01-22T23:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Importing user picture ressource from AD using OLE DB Provider for Microsoft Directory Services</title>
      <link>https://community.qlik.com/t5/QlikView/Importing-user-picture-ressource-from-AD-using-OLE-DB-Provider/m-p/616341#M681769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the reply.&lt;/P&gt;&lt;P&gt;I did not pursue this topic any further, but I do think it's a limitation of the AD / OLE DB provider for Microsoft Directory Services.&lt;/P&gt;&lt;P&gt;Unfortunately I have no clue as to how this limitation can be circumvented.&lt;/P&gt;&lt;P&gt;Maybe by loading parts of the data in a loop and concatenate afterwards.&lt;/P&gt;&lt;P&gt;There are posts that describe loading other AD account information in a loop because of those limitations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If someone found a solution, I would be interested in learning from it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2015 23:51:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Importing-user-picture-ressource-from-AD-using-OLE-DB-Provider/m-p/616341#M681769</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2015-01-22T23:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: Importing user picture ressource from AD using OLE DB Provider for Microsoft Directory Services</title>
      <link>https://community.qlik.com/t5/QlikView/Importing-user-picture-ressource-from-AD-using-OLE-DB-Provider/m-p/616342#M681770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I believe that limitation is 999 or 1000 records, per request. I had to loop through each last name letter to get everyone. Yours is the first attempt I've seen to get the thumbnails, and although imperfect as it is its a good start.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--john&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jan 2015 15:42:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Importing-user-picture-ressource-from-AD-using-OLE-DB-Provider/m-p/616342#M681770</guid>
      <dc:creator>johnca</dc:creator>
      <dc:date>2015-01-23T15:42:24Z</dc:date>
    </item>
  </channel>
</rss>

