<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>DAU-Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/dau-blog/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/dau-blog/feed.xml</link>
    <description />
    <lastBuildDate>Fri, 24 Jul 2015 08:22:43 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>How to capture Exceptions in Process Monitor Traces using PocDump</title>
      <link>https://docs.microsoft.com/archive/blogs/dau-blog/how-to-capture-exceptions-in-process-monitor-traces-using-pocdump</link>
      <pubDate>Tue, 04 Dec 2012 07:05:13 GMT</pubDate>
      <dc:creator><![CDATA[Sebastian Dau]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dau-blog/2012/12/04/how-to-capture-exceptions-in-process-monitor-traces-using-pocdump/</guid>
      <description><![CDATA[ProcDump was updated to version 5 coming with some great new features targeting exception filtering...]]></description>
      <content:encoded><![CDATA[<p><a href="https://technet.microsoft.com/en-us/sysinternals/dd996900.aspx">ProcDump</a> was updated to version 5 coming with some great new features targeting exception filtering and the like.</p>  <p>For instance you can now write a dump at the time a specific first chance exception was raised using the exception name:</p>  <p><font face="Courier New"><strong><em>procdump –ma –e 1 –f “System.Exception” myprocess.exe</em></strong></font></p>  <p>&#160;</p>  <p>What’s also new and little hidden it the possibility to trace exception information in <a href="https://technet.microsoft.com/en-us/sysinternals/bb896645.aspx">Process Monitor (ProcMon)</a> traces.</p>  <p>In order to do this, you just need to attach procdump to the process you are interested in and tell it to observe all 1st chance exceptions:</p>  <p><font face="Courier New"><strong><em>procdump –e 1 –f “” myprocess.exe</em></strong></font></p>  <p>When you now collect a procmon trace while exceptions occur, you will see them as Debug Output Profiling Operation Events coming out of the attached procmon instance:</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/48/09/metablogapi/2514.image_33FF4FCE.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-48-09-metablogapi/2514.image_5F00_33FF4FCE.png"><img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/48/09/metablogapi/4251.image_thumb_19BEE6AA.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-48-09-metablogapi/4251.image_5F00_thumb_5F00_19BEE6AA.png" width="778" height="204" /></a></p>  <p>Notice: You need to enable Profiling events to be displayed and make sure procmon,exe is not filtered as it was default until version 5.</p>  <p>This will work for managed and unmanaged exceptions as well.</p>  <p>&#160;</p>  <p>Limitation: As you might now ProcMon can show you the call stack of the events. However, as the profiling event is generated from procmon itself and not the process that is actually monitored, these call stacks do not indicate where the exception was thrown.</p>]]></content:encoded>
    </item>
    <item>
      <title>Setting the right DirectoryEntry for DirectorySearcher used for DirectorySynchronization</title>
      <link>https://docs.microsoft.com/archive/blogs/dau-blog/setting-the-right-directoryentry-for-directorysearcher-used-for-directorysynchronization</link>
      <pubDate>Fri, 21 Sep 2012 00:26:58 GMT</pubDate>
      <dc:creator><![CDATA[Sebastian Dau]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dau-blog/2012/09/21/setting-the-right-directoryentry-for-directorysearcher-used-for-directorysynchronization/</guid>
      <description><![CDATA[This week I was asked why one would get the an AccessDenied Error Code when accessing the...]]></description>
      <content:encoded><![CDATA[<p><font face="Segoe UI">This week I was asked why one would get the an AccessDenied Error Code when accessing the </font><a href="https://msdn.microsoft.com/en-US/library/system.directoryservices.directorysearcher.findone(v=vs.80).aspx"><font face="Segoe UI">DirectorySearcher.FindOne Method</font></a><font face="Segoe UI"> while the </font></p>  <p><a href="https://msdn.microsoft.com/en-US/library/system.directoryservices.directorysearcher.directorysynchronization(v=vs.80).aspx"><font face="Segoe UI">DirectorySearcher.DirectorySynchronization Property</font></a><font face="Segoe UI"> is set and the </font><a href="https://msdn.microsoft.com/en-us/library/87tye19w.aspx"><font face="Segoe UI">DirectoryEntry</font></a><font face="Segoe UI"> is set to an Organisational Unit (OU) rather.</font></p>  <p><font face="Segoe UI">The following Example explains</font> </p>  <div class="csharpcode">   <pre class="alt"><span class="lnum">   1:  </span><span class="kwrd">using</span> (DirectoryEntry deRoot = <span class="kwrd">new</span> DirectoryEntry(<span class="str">&quot;LDAP://<font style="background-color: rgb(255, 255, 0);">OU=MyOU</font>,DC=yourDomain,DC=com&quot;</span>))</pre>

  <pre><span class="lnum">   2:  </span>{</pre>

  <pre class="alt"><span class="lnum">   3:  </span>                <span class="kwrd">using</span> (DirectorySearcher ret = <span class="kwrd">new</span> DirectorySearcher(deRoot))</pre>

  <pre><span class="lnum">   4:  </span>                {                  </pre>

  <pre class="alt"><span class="lnum">   5:  </span>                    ret.DirectorySynchronization = <span class="kwrd">new</span> DirectorySynchronization();</pre>

  <pre><span class="lnum">   6:  </span>                    ret.DirectorySynchronization.Option = DirectorySynchronizationOptions.IncrementalValues;</pre>

  <pre class="alt"><span class="lnum">   7:  </span>&#160;</pre>

  <pre><span class="lnum">   8:  </span>                    <span class="kwrd">foreach</span> (var result <span class="kwrd">in</span> ret.FindAll())</pre>

  <pre class="alt"><span class="lnum">   9:  </span>                    {</pre>

  <pre><span class="lnum">  10:  </span>                        <span class="rem">//do</span></pre>

  <pre class="alt"><span class="lnum">  11:  </span>                    }</pre>

  <pre><span class="lnum">  12:  </span>                }</pre>

  <pre class="alt"><span class="lnum">  13:  </span>}</pre>
</div>


<p><font face="Segoe UI">While browsing the documentation and talking to an US colleague I realised that underneath the whole managed DirectoryServices infrastructure the </font><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms677626(v=vs.85).aspx"><font face="Segoe UI">DirSync Control is used for Directory Synchronization</font></a><font face="Segoe UI">.</font></p>

<p><font face="Segoe UI">Following the Parameter description I found:</font></p>

<p><font face="Segoe UI"></font></p>

<p><em><strong><font face="Segoe UI">“The base of a DirSync search must be the root of a directory partition, which can be a domain partition, the configuration partition, or the schema partition.”</font></strong></em></p>

<p>So the solution to the AccessDenied error is actuall pretty simple: <strong>Set the DirectoryEntry to the</strong> <strong>domain partition, the configuration partition, or the schema Partition </strong>when using it in conjunction with DirectorySynchronization and make use of the Filter Property when targeting at specific Sub segments of your Domain such as OUs.</p>

<p>See the correct example:</p>

<div class="csharpcode">
  <pre class="alt"><span class="lnum">   1:  </span><span class="kwrd">using</span> (DirectoryEntry deRoot = <span class="kwrd">new</span> DirectoryEntry(<span class="str">&quot;<font style="background-color: rgb(255, 255, 0);">LDAP://DC=yourDomain,DC=com</font>&quot;</span>))</pre>

  <pre><span class="lnum">   2:  </span>{</pre>

  <pre class="alt"><span class="lnum">   3:  </span>                <span class="kwrd">using</span> (DirectorySearcher ret = <span class="kwrd">new</span> DirectorySearcher(deRoot))</pre>

  <pre><span class="lnum">   4:  </span>                {</pre>

  <pre class="alt"><span class="lnum">   5:  </span>                    ret.Filter = <span class="str">&quot;<font style="background-color: rgb(255, 255, 0);">OU=MyOU</font>&quot;</span>;</pre>

  <pre><span class="lnum">   6:  </span>                    ret.DirectorySynchronization = <span class="kwrd">new</span> DirectorySynchronization();</pre>

  <pre class="alt"><span class="lnum">   7:  </span>                    ret.DirectorySynchronization.Option = DirectorySynchronizationOptions.IncrementalValues;</pre>

  <pre><span class="lnum">   8:  </span>&#160;</pre>

  <pre class="alt"><span class="lnum">   9:  </span>                    <span class="kwrd">foreach</span> (var result <span class="kwrd">in</span> ret.FindAll())</pre>

  <pre><span class="lnum">  10:  </span>                    {</pre>

  <pre class="alt"><span class="lnum">  11:  </span>                        <span class="rem">//do</span></pre>

  <pre><span class="lnum">  12:  </span>                    }</pre>

  <pre class="alt"><span class="lnum">  13:  </span>                }</pre>

  <pre><span class="lnum">  14:  </span>}</pre>

  <pre class="alt"><span class="lnum">  15:  </span>&#160;</pre>
</div>


<p>I hope this works well for you, too. You are welcome to drop me a comment, once succeeded <img class="wlEmoticon wlEmoticon-smile" style="style" alt="Smile" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/48/09/metablogapi/8284.wlEmoticon-smile_1F2E78FB.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-48-09-metablogapi/8284.wlEmoticon_2D00_smile_5F00_1F2E78FB.png" /></p>]]></content:encoded>
    </item>
    <item>
      <title>WaitHandle.WaitAll throws NotSupportedException when joining more than 64 WaitHandled</title>
      <link>https://docs.microsoft.com/archive/blogs/dau-blog/waithandle-waitall-throws-notsupportedexception-when-joining-more-than-64-waithandled</link>
      <pubDate>Mon, 23 Jul 2012 05:51:36 GMT</pubDate>
      <dc:creator><![CDATA[Sebastian Dau]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dau-blog/2012/07/23/waithandle-waitall-throws-notsupportedexception-when-joining-more-than-64-waithandled/</guid>
      <description><![CDATA[I was just looking after a Problem where a customer was not able to join more than 64 wait handles...]]></description>
      <content:encoded><![CDATA[<p>I was just looking after a Problem where a customer was not able to join more than 64 wait handles in a WaitOne method call.</p>  <p>This is because of an internal limitation trying to prevent you from exhaustive usage of synchronization primitives.</p>  <p>MSDN mentions it in the remark section:</p>  <p><a title="https://msdn.microsoft.com/en-us/library/z6w25xa6(v=vs.90).aspx" href="https://msdn.microsoft.com/en-us/library/z6w25xa6(v=vs.90).aspx">https://msdn.microsoft.com/en-us/library/z6w25xa6(v=vs.90).aspx</a></p>  <p>“On some implementations, if more than 64 handles are passed, a <a href="https://msdn.microsoft.com/en-us/library/system.notsupportedexception(v=vs.90).aspx">NotSupportedException</a> is thrown.”</p>  <p>My customer was under heavy time pressure with his project and just did not have enough time to refactor his threading approach which would have been the better solution actually.</p>  <p>So I suggested him to group all his waithandles in max 64 element arrays and joining them sequencially group by group.</p>  <p>The solution worked well thus I’m going to share it for you just in case … <img class="wlEmoticon wlEmoticon-smile" style="style" alt="Smile" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/48/09/metablogapi/4401.wlEmoticon-smile_16D579C3.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-48-09-metablogapi/4401.wlEmoticon_2D00_smile_5F00_16D579C3.png" /></p>  <div class="csharpcode">   <pre class="alt"><span class="lnum">   1:  </span>&#160;</pre>

  <pre><span class="lnum">   2:  </span><span class="kwrd">using</span> System;</pre>

  <pre class="alt"><span class="lnum">   3:  </span><span class="kwrd">using</span> System.Collections.Generic;</pre>

  <pre><span class="lnum">   4:  </span><span class="kwrd">using</span> System.Diagnostics;</pre>

  <pre class="alt"><span class="lnum">   5:  </span><span class="kwrd">using</span> System.Linq;</pre>

  <pre><span class="lnum">   6:  </span><span class="kwrd">using</span> System.Text;</pre>

  <pre class="alt"><span class="lnum">   7:  </span><span class="kwrd">using</span> System.Threading;</pre>

  <pre><span class="lnum">   8:  </span>&#160;</pre>

  <pre class="alt"><span class="lnum">   9:  </span><span class="kwrd">namespace</span> Hook</pre>

  <pre><span class="lnum">  10:  </span>{</pre>

  <pre class="alt"><span class="lnum">  11:  </span>    <span class="kwrd">class</span> Program</pre>

  <pre><span class="lnum">  12:  </span>    {</pre>

  <pre class="alt"><span class="lnum">  13:  </span>        <span class="kwrd">static</span> <span class="kwrd">void</span> Main(<span class="kwrd">string</span>[] args)</pre>

  <pre><span class="lnum">  14:  </span>        {</pre>

  <pre class="alt"><span class="lnum">  15:  </span>            Thread[] threads = <span class="kwrd">new</span> Thread[128];</pre>

  <pre><span class="lnum">  16:  </span>            WaitHandle[] whs = <span class="kwrd">new</span> WaitHandle[64];</pre>

  <pre class="alt"><span class="lnum">  17:  </span>            WaitHandle[] whs2 = <span class="kwrd">new</span> WaitHandle[64];</pre>

  <pre><span class="lnum">  18:  </span>            <span class="kwrd">for</span> (<span class="kwrd">int</span> i = 0; i &lt; 128; i++)</pre>

  <pre class="alt"><span class="lnum">  19:  </span>            {</pre>

  <pre><span class="lnum">  20:  </span>                WaitHandle wh = <span class="kwrd">new</span> AutoResetEvent(<span class="kwrd">false</span>);</pre>

  <pre class="alt"><span class="lnum">  21:  </span>                <span class="kwrd">if</span> (i &gt;= 64)</pre>

  <pre><span class="lnum">  22:  </span>                    whs2[i - 64] = wh;</pre>

  <pre class="alt"><span class="lnum">  23:  </span>                <span class="kwrd">else</span></pre>

  <pre><span class="lnum">  24:  </span>                    whs[i] = wh;</pre>

  <pre class="alt"><span class="lnum">  25:  </span>&#160;</pre>

  <pre><span class="lnum">  26:  </span>                threads[i] = <span class="kwrd">new</span> Thread(DoNo);</pre>

  <pre class="alt"><span class="lnum">  27:  </span>                threads[i].Start(wh);</pre>

  <pre><span class="lnum">  28:  </span>            }</pre>

  <pre class="alt"><span class="lnum">  29:  </span>&#160;</pre>

  <pre><span class="lnum">  30:  </span>            WaitHandle.WaitAll(whs);</pre>

  <pre class="alt"><span class="lnum">  31:  </span>            WaitHandle.WaitAll(whs2);</pre>

  <pre><span class="lnum">  32:  </span>        }</pre>

  <pre class="alt"><span class="lnum">  33:  </span>&#160;</pre>

  <pre><span class="lnum">  34:  </span>        <span class="kwrd">private</span> <span class="kwrd">static</span> <span class="kwrd">void</span> DoNo(<span class="kwrd">object</span> obj)</pre>

  <pre class="alt"><span class="lnum">  35:  </span>        {</pre>

  <pre><span class="lnum">  36:  </span>            Thread.Sleep(1000);</pre>

  <pre class="alt"><span class="lnum">  37:  </span>            AutoResetEvent wh = (AutoResetEvent)obj;</pre>

  <pre><span class="lnum">  38:  </span>            wh.Set();</pre>

  <pre class="alt"><span class="lnum">  39:  </span>        }</pre>

  <pre><span class="lnum">  40:  </span>    }</pre>

  <pre class="alt"><span class="lnum">  41:  </span>}</pre>
</div>




<p>Hope it works for you, too!</p>

<p>Sebastian</p>]]></content:encoded>
    </item>
    <item>
      <title>GdipDrawImageRect and other GDI+ functions may return GenericError (-1) on Windows 7</title>
      <link>https://docs.microsoft.com/archive/blogs/dau-blog/gdipdrawimagerect-and-other-gdi-functions-may-return-genericerror-1-on-windows-7</link>
      <pubDate>Mon, 23 Jul 2012 01:57:24 GMT</pubDate>
      <dc:creator><![CDATA[Sebastian Dau]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dau-blog/2012/07/23/gdipdrawimagerect-and-other-gdi-functions-may-return-genericerror-1-on-windows-7/</guid>
      <description><![CDATA[I came across an anyoing issue where GDI plus functions returned Status code –1 GenericError after...]]></description>
      <content:encoded><![CDATA[<p>I came across an anyoing issue where GDI plus functions returned <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms534175(v=vs.85).aspx">Status code</a> –1 GenericError after 1000 calls on Systems running Windows 7 or Windows Server 2008 R2.</p>  <p>It turned out that the function call to kernel NtGdiSaveDC(hdc); Returns 0x0 after 999 iterations or at the 1000th call that is.</p>  <p>The public callstack subset looks like this:</p>  <p><em><font face="Courier New">…</font></em></p>  <p><em><font face="Courier New">gdiplus!MfEnumState::MfEnumState+0x85        <br />gdiplus!WmfEnumState::WmfEnumState+0x25         <br />gdiplus!MetafilePlayer::EnumerateWmfRecords+0x6e         <br />gdiplus!GpGraphics::EnumEmf+0x282         <br />gdiplus!GpMetafile::EnumerateForPlayback+0x5a7         <br />gdiplus!GpGraphics::DrawImage+0x3f5         <br />gdiplus!GpGraphics::DrawImage+0x51         <br />gdiplus!GdipDrawImageRect+0x114</font></em> </p>  <p>…</p>  <p>&#160;</p>  <p>In the knowledge base I found that there is a Hotfix indeed to adress such issues in Win7 and Win Server 2008 R2.</p>  <p><a title="https://support.microsoft.com/kb/2525949" href="https://support.microsoft.com/kb/2525949"><strong>https://support.microsoft.com/kb/2525949</strong></a></p>  <p>&#160;</p>  <p>It helped for my problem and I hope it will help you too!</p>  <p>&#160;</p>  <p>Sebastian</p>]]></content:encoded>
    </item>
    <item>
      <title>Event Logging API function “ReportEvent” Returns “ERROR_INVALID_PARAMETER” 0x57 when Event Source contains predefined XML entities</title>
      <link>https://docs.microsoft.com/archive/blogs/dau-blog/event-logging-api-function-reportevent-returns-error_invalid_parameter-0x57-when-event-source-contains-predefined-xml-entities</link>
      <pubDate>Mon, 02 Jul 2012 04:22:00 GMT</pubDate>
      <dc:creator><![CDATA[Sebastian Dau]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dau-blog/2012/07/02/event-logging-api-function-reportevent-returns-error_invalid_parameter-0x57-when-event-source-contains-predefined-xml-entities/</guid>
      <description><![CDATA[The Event Logging API allows user code to write Event Information into the Windows Event Log.
There...]]></description>
      <content:encoded><![CDATA[<p>The Event Logging API allows user code to write Event Information into the Windows Event Log.</p>
<p>There is a nice example how to do it in MSDN: <a title="https://msdn.microsoft.com/en-us/library/windows/desktop/aa363680(v=vs.85).aspx" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa363680(v=vs.85).aspx">https://msdn.microsoft.com/en-us/library/windows/desktop/aa363680(v=vs.85).aspx</a></p>
<p>When you are using the function <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa363679(v=vs.85).aspx">ReportEvent</a> the function might return the error&nbsp; ERROR_INVALID_PARAMETER (0x57) if you are trying to report an event to an <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa363678(v=vs.85).aspx">Event Source</a> if the Source Name contains <a href="https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML">characters predefined in XML</a> such as: <strong><span style="color: #000000;" color="#000000">&ldquo;, &amp;, &lsquo; &lt;, &gt;</span></strong></p>
<p><span style="color: #000000;" color="#000000">Example Event Source: </span><span style="color: #000000;" color="#000000"><strong><em>My&lt;EventProvider&gt;</em></strong></span></p>
<p><span style="color: #000000;" color="#000000">The Problem with that is, that the underneath Event Logging Engine logs into XML files internally. Thus, using predefined XML characters causes subsequent validations to fail.</span></p>
<p><span style="color: #000000;" color="#000000">You can work around this problem by making use of the appropriate esacpe sequences:</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/48/09/metablogapi/3223.Capture_70CEDF99.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-48-09-metablogapi/3223.Capture_5F00_70CEDF99.png"><img width="196" height="244" title="Capture" style="display: inline; background-image: none;" alt="Capture" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/48/09/metablogapi/7485.Capture_thumb_40A794D6.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-48-09-metablogapi/7485.Capture_5F00_thumb_5F00_40A794D6.png" border="0" /></a></p>
<p>&nbsp;</p>
<p>Example of an Event Source containing XML escape sequences: <strong><em>My&amp;lt;EventProvider&amp;gt;</em></strong></p>
<p><strong><em></em></strong></p>
<p>You need to apply the same logic for while reistering your custom Event Provider as shown below:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/48/09/metablogapi/3771.image_771846D8.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-48-09-metablogapi/3771.image_5F00_771846D8.png"><img width="772" height="120" title="image" style="margin: 0px; display: inline; background-image: none;" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/48/09/metablogapi/0131.image_thumb_2669BC63.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-48-09-metablogapi/0131.image_5F00_thumb_5F00_2669BC63.png" border="0" /></a></p>
<p>This is how it looks like when it succeeds:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/48/09/metablogapi/4338.el_3195D75E.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-48-09-metablogapi/4338.el_5F00_3195D75E.png"><img width="479" height="123" title="el" style="display: inline; background-image: none;" alt="el" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/48/09/metablogapi/3755.el_thumb_655DCDAF.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-48-09-metablogapi/3755.el_5F00_thumb_5F00_655DCDAF.png" border="0" /></a></p>
<p>Please let me know how it worked for you!</p>]]></content:encoded>
    </item>
    <item>
      <title>async Bing for Metro Style Apps</title>
      <link>https://docs.microsoft.com/archive/blogs/dau-blog/async-bing-for-metro-style-apps</link>
      <pubDate>Mon, 11 Jun 2012 13:10:00 GMT</pubDate>
      <dc:creator><![CDATA[Sebastian Dau]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dau-blog/2012/06/11/async-bing-for-metro-style-apps/</guid>
      <description><![CDATA[While getting ready to support customers    developing great Windows 8 Metro Style Apps I started...]]></description>
      <content:encoded><![CDATA[<p>While getting ready to support customers    <br />developing great Windows 8 Metro Style Apps I started creating an App myself.</p>  <p>I chose to write some code that queries <a title="https://www.bing.com/toolbox/bingdeveloper/" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/Bing Search Service">Bing Search Service</a> for Images and displays results as     <br />tiles.</p>  <p>I stumbled across some things that I want to share with you.</p>  <p>For details how to code against Bing Search please refer to the docs I will focus only on the steps necessary to    <br />incorporate it in Metro Apps.</p>  <p>1) Download the latest <a title="https://datamarket.azure.com/dataset/explore/getproxy/5ba839f1-12ce-4cce-bf57-a49d98d29a44" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/Bing Azure Service Proxy">Bing Azure Service Proxy</a> and add the code file to your Metro App Project</p>  <p>2) With only default references the code does not compile you need to add references to the following Lib:</p>  <p>&#160;&#160;&#160; <strong>C:\Program Files (x86)\Microsoft WCF Data Services\5.0\bin\Metro\Microsoft.Data.Services.Client.Metro.dll</strong></p>  <p>3) You can now declare a bing search Service Proxy and create an instance consuming the Service Url and your unique ID:</p>  <pre class="csharpcode">BingSearchContainer bs = <span class="kwrd">new</span> BingSearchContainer(<span class="kwrd">new</span> Uri(<span class="str">&quot;https://api.datamarket.azure.com/Bing/Search/&quot;</span>));
_bsc.Credentials = <span class="kwrd">new</span> System.Net.NetworkCredential(&quot;YOUR_ID”,”YOUR_ID”);
</pre>


<p>4) Now, in order to run an actual query you need to create query object providing a query string and other options that 
  <br />are unused in this example:</p>

<pre class="csharpcode">var webQ = _bsc.Image(search.Text, <span class="kwrd">null</span>, <span class="kwrd">null</span>, <span class="kwrd">null</span>, <span class="kwrd">null</span>, <span class="kwrd">null</span>);</pre>


<p>5) You could now use the query object’s BeginExecute EndExecute Methods to asynchronously receive results using the 
  <br />well-known <a href="https://msdn.microsoft.com/en-us/magazine/cc163323.aspx">Asynch Programming Pattern</a> (APM).</p>

<p>6) But you could also make use of the new new async / await keywords. In order to do this you need to bridge between the 
  <br />old APM the newer Task Parallel Librariy (TPL) to return a Task object which is required by the async keyword. The <a href="https://blogs.msdn.com/b/pfxteam/archive/2009/06/09/9716439.aspx">TaskFactory</a> 

  <br />helps you with that:</p>

<pre class="csharpcode">Task&lt;<span class="kwrd">int</span>&gt; bytesRead = Task&lt;<span class="kwrd">int</span>&gt;.Factory.FromAsync( stream.BeginRead, stream.EndRead, buffer, 0, buffer.Length, <span class="kwrd">null</span>);</pre>


<p> 7) I found it handy to use a generic extension method decorating the Bing Query with an await-compatible method that 
  <br />returns the type you request for such as web results, images etc:</p>

<p>&#160;</p>

<pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">class</span> QueryExtensions   
{        
     <span class="kwrd">public</span> <span class="kwrd">static</span> Task&lt;IEnumerable&lt;TResult&gt;&gt; QueryAsync&lt;TResult&gt;(<span class="kwrd">this</span> DataServiceQuery&lt;TResult&gt; query)
     {
            <span class="kwrd">return</span> Task&lt;IEnumerable&lt;TResult&gt;&gt;.Factory.FromAsync(query.BeginExecute, query.EndExecute, <span class="kwrd">null</span>);
     }
} 
</pre>


<p><span style="font-family: courier new,courier;"></span></p>

<p>8) Even though the implementation might look a little awkward, it’s application doesn’t and smart and simple. I assume 
  <br />you are familiar with data-binding to Objects in the DefaultViewModel using Xaml:</p>

<pre class="csharpcode">DefaultViewModel[<span class="str">&quot;Items&quot;</span>] = await webQ.QueryAsync() ;</pre>


<p>Hope it helps you easily integrating Bing Search Service into your Metro Apps – Happy coding!</p>

<p>PS: The Demo Project is attached to this post.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/31/85/26/App1.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-31-85-26/App1.zip">App1.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>How to: grant “Manage Build Resources” Privilege to users with tfssecurity.exe</title>
      <link>https://docs.microsoft.com/archive/blogs/dau-blog/how-to-grant-manage-build-resources-privilege-to-users-with-tfssecurity-exe</link>
      <pubDate>Fri, 25 May 2012 05:00:44 GMT</pubDate>
      <dc:creator><![CDATA[Sebastian Dau]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dau-blog/2012/05/25/how-to-grant-manage-build-resources-privilege-to-users-with-tfssecurity-exe/</guid>
      <description><![CDATA[TFS allows flexible setup. It can be customized to address most peoples requirements.  Everything...]]></description>
      <content:encoded><![CDATA[<p>TFS allows flexible setup. It can be customized to address most peoples requirements.</p>  <p>Everything that can be changed with TFS Explorer in the UI can also be modified using the API and command line tools.</p>  <p>TFSSECURITY.EXE is one of those allowing to batch script modifications to TFS’s security interface.</p>  <p><strong>However</strong>, for some scenarios the tool application is pretty complicated as the required input parameters are hard to figure out due to&#160; their low level.</p>  <p>A customer asked me how to grant or deny a set o users the privilege to manage build resources via shell script.</p>  <p>the syntax looks pretty straight forward:</p>  <div style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: rgb(244, 244, 244);" id="codeSnippetWrapper">   <div style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);" id="codeSnippet">     <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum1">   1:</span> tfssecurity /a+ Namespace, Token and Action &lt;user/group&gt; Allow /collection:&lt;collectionURI&gt;</pre>
<!--CRLF--></div>
</div>

<p>But how do you get all three parameters <strong>Namespace, Token and Action</strong>?</p>

<p>To get the namespace use TFSSecurity /a against the collection:</p>

<div style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: rgb(244, 244, 244);" id="codeSnippetWrapper">
  <div style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);" id="codeSnippet">
    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum1">   1:</span> tfssecurity /a /collection:&lt;collectionURI&gt;</pre>
<!--CRLF--></div>
</div>

<p>Output [<strong>Namespaces</strong>]:</p>

<p><strong>WorkItemQueryFolders
    <br />Registry

    <br />VersionControlItems

    <br />Identity

    <br />Job

    <br />Server

    <br />Collection

    <br />BuildAdministration

    <br />VersionControlPrivileges

    <br />Workspaces

    <br />Project

    <br />EventSubscription

    <br />CSS

    <br />TeamLabSecurity

    <br />Iteration

    <br />Build

    <br /></strong></p>

<p>Reading the token is the most tricky part and neither my EE colleague nor the WWW cam up with a better solution than running a SQL query against the confid DB:</p>

<div style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: rgb(244, 244, 244);" id="codeSnippetWrapper">
  <div style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);" id="codeSnippet">
    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum1">   1:</span> <span style="color: rgb(0, 0, 255);">select</span> <span style="color: rgb(0, 0, 255);">distinct</span> SecurityToken</pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);" id="lnum2">   2:</span> <span style="color: rgb(0, 0, 255);">from</span> Tfs_DefaultCollection..tbl_SecurityAccessControlEntry </pre>
<!--CRLF-->

    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum3">   3:</span> <span style="color: rgb(0, 0, 255);">where</span> (SecurityToken <span style="color: rgb(0, 0, 255);">not</span> <span style="color: rgb(0, 0, 255);">like</span> <span style="color: rgb(0, 96, 128);">'%/%'</span> )<span style="color: rgb(0, 0, 255);">and</span> (SecurityToken <span style="color: rgb(0, 0, 255);">not</span> <span style="color: rgb(0, 0, 255);">like</span> <span style="color: rgb(0, 96, 128);">'%$%'</span>)</pre>
<!--CRLF--></div>
</div>

<p>Output [<strong>Tokens</strong>]<strong>:</strong></p>

<p><strong>BuildPrivileges
    <br />FrameworkGlobalSecurity

    <br />Global

    <br />NAMESPACE:</strong></p>

<p>The action can be queried with tfssecurity once more (syntax):</p>

<div style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: rgb(244, 244, 244);" id="codeSnippetWrapper">
  <div style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);" id="codeSnippet">
    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum1">   1:</span> :  tfssecurity /a Namespace Token /collection:&lt;collectionURI&gt;</pre>
<!--CRLF--></div>
</div>

<p>Example:</p>

<div style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: rgb(244, 244, 244);" id="codeSnippetWrapper">
  <div style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);" id="codeSnippet">
    <pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &quot;Courier New&quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: rgb(96, 96, 96);" id="lnum1">   1:</span> tfssecurity /a BuildAdministration BuildPrivileges /collection:&lt;collectionURI&gt;</pre>
<!--CRLF--></div>
</div>

<p>Output [Build Management Privileges]</p>

<p><strong>ViewBuildResources
    <br />ManageBuildResources

    <br />UseBuildResources</strong></p>

<p>Notice: This post focuses on build management privileges and does not cover all possible scenarios.</p>

<p>There is a pretty detailed forum answer in the MSDN forums which covers alternative ways to retrieve tokens for other tasks:</p>

<p><a title="https://social.msdn.microsoft.com/Forums/en-US/tfsadmin/thread/f55d218f-03be-4825-ae1b-3988152a805d/" href="https://social.msdn.microsoft.com/Forums/en-US/tfsadmin/thread/f55d218f-03be-4825-ae1b-3988152a805d/">https://social.msdn.microsoft.com/Forums/en-US/tfsadmin/thread/f55d218f-03be-4825-ae1b-3988152a805d/</a></p>

<p>I’d love to read your feedback if this article helped you solve your problem!</p>]]></content:encoded>
    </item>
    <item>
      <title>How to solve “Unable to cast COM object of type Microsoft.Office.Interop.Excel.ApplicationClass' to interface type 'Microsoft.Office.Interop.Excel._Application'”</title>
      <link>https://docs.microsoft.com/archive/blogs/dau-blog/how-to-solve-unable-to-cast-com-object-of-type-microsoft-office-interop-excel-applicationclass-to-interface-type-microsoft-office-interop-excel-_application</link>
      <pubDate>Fri, 20 Apr 2012 07:35:00 GMT</pubDate>
      <dc:creator><![CDATA[Sebastian Dau]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dau-blog/2012/04/20/how-to-solve-unable-to-cast-com-object-of-type-microsoft-office-interop-excel-applicationclass-to-interface-type-microsoft-office-interop-excel-_application/</guid>
      <description><![CDATA[Recently I was working on a problem where a customer received that error message when trying to open...]]></description>
      <content:encoded><![CDATA[<p>Recently I was working on a problem where a customer received that error message when trying to open a TFS work item list in Excel triggered from Team Explorer.</p>
<p>The error did not appear when opening Excel right away and accessing a TFS query.</p>
<p>I was checking Process Monitor to see what was going on underneath using the comparison technique that I learned from <a href="https://blogs.technet.com/b/markrussinovich/archive/2011/11/29/3467449.aspx">Mark Russinovich</a>.</p>
<p>It turned out that Excel 2007 was installed and it&rsquo;s COM Classes are registered in <strong>HKCR\TypeLib\{00020813-0000-0000-C000-000000000046}\<span style="background-color: #ffff00;">1.6.</span></strong></p>
<p>In contrast when Team Explorer wanted call Excel through COM automation it used <strong>HKCR\TypeLib\{00020813-0000-0000-C000-000000000046}\<span style="background-color: #ffff00;">1.7.</span></strong></p>
<p>Obviously TFS was trying to talk to Excel 2010 instead which was not present.</p>
<p>So I rang the customer to discuss it further and it turned out that they installed Project 2010 to these boxes running Office 2007 that seemed to have added a newer automation class registry key for Excel though even though it was not even installed.</p>
<p>Anyway, deleting the key <strong>HKCR\TypeLib\{00020813-0000-0000-C000-000000000046}\<span style="background-color: #ffff00;">1.7 </span></strong>solved the issue for the customer.</p>
<p>Project, Excel and Team Explorer work fine with that tiny little change.</p>
<p>My learnings: &ldquo;When in doubt, run process monitor.&rdquo; <img class="wlEmoticon wlEmoticon-smile" alt="Smiley" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/48/09/metablogapi/8764.wlEmoticon-smile_277E5010.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-48-09-metablogapi/8764.wlEmoticon_2D00_smile_5F00_277E5010.png" /></p>]]></content:encoded>
    </item>
    <item>
      <title>Mouse not captured in remote desktop session when Virtual PC VHD file runs in Hyper-V</title>
      <link>https://docs.microsoft.com/archive/blogs/dau-blog/mouse-not-captured-in-remote-desktop-session-when-virtual-pc-vhd-file-runs-in-hyper-v</link>
      <pubDate>Tue, 28 Feb 2012 04:11:28 GMT</pubDate>
      <dc:creator><![CDATA[Sebastian Dau]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dau-blog/2012/02/28/mouse-not-captured-in-remote-desktop-session-when-virtual-pc-vhd-file-runs-in-hyper-v/</guid>
      <description><![CDATA[Today I received a Virtual PC VHD file that I needed to run in my Hyper-V system. It booted fine but...]]></description>
      <content:encoded><![CDATA[<p>Today I received a Virtual PC VHD file that I needed to run in my Hyper-V system. It booted fine but the mouse did not respond.</p>  <p>The Hyper-V console’s status bar kept saying “Mouse not captured in remote desktop session“.</p>  <p>Fixing that issue is a little tricky and requires some keyboard acrobatics:</p>  <p>1) <strong>Uninstall the Virtual PC Tools</strong>… but how to reach the start button without a mouse and a Windows Key?</p>  <blockquote>   <p>-&gt; <strong>ALT+HOME is your friend and emulates the Windows Key</strong>!</p>    <p>-&gt; Now just type “features” and press enter to open the list of installed programs</p>    <p>-&gt; once the Programs and Features Window has opened press TAB until the actual list view has focus (boarders)</p>    <p>-&gt; Press ENTER on the Virtual PC Tools and choose to uninstall</p> </blockquote>  <p>2) <strong>Install Hyper-V Tools now</strong></p>  <blockquote>   <p>-&gt; In the Hyper-V Console Menu choose to insert the Integration Services Setup Disk</p>    <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/48/09/metablogapi/5001.image_7C05BC5A.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-48-09-metablogapi/5001.image_5F00_7C05BC5A.png"><img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/48/09/metablogapi/8625.image_thumb_1D553C2A.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-48-09-metablogapi/8625.image_5F00_thumb_5F00_1D553C2A.png" width="263" height="208" /></a></p>    <p>-&gt; Now Autorun asks you whether to run the setup… just go for it.</p> </blockquote>  <p>3) The last and most tricky part (I didn’t know the option at all) is to<strong> make the guest OS use the changed hardware</strong></p>  <blockquote>   <p>-&gt; Press ALT+HOME and navigate to “Run” </p>    <p>-&gt; type <strong>msconfig</strong> and open the boot page</p>    <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/48/09/metablogapi/0602.image_7BF5968D.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-48-09-metablogapi/0602.image_5F00_7BF5968D.png"><img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/48/09/metablogapi/0285.image_thumb_33C7DAB1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-48-09-metablogapi/0285.image_5F00_thumb_5F00_33C7DAB1.png" width="359" height="238" /></a></p>    <p>-&gt; Enable “<strong>Detect HAL</strong>” </p>    <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/48/09/metablogapi/1263.image_6B2DEBDF.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-48-09-metablogapi/1263.image_5F00_6B2DEBDF.png"><img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/48/09/metablogapi/5076.image_thumb_50ED82BB.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-48-09-metablogapi/5076.image_5F00_thumb_5F00_50ED82BB.png" width="288" height="284" /></a></p>    <p>-&gt; Close the dialogs and restart the system to activate your changes and your mouse should be working right away!</p></blockquote>]]></content:encoded>
    </item>
    <item>
      <title>How do I access msExchRecipientTypeDetails Property Values through the ADSI LDAP Provider (Ole Db)</title>
      <link>https://docs.microsoft.com/archive/blogs/dau-blog/how-do-i-access-msexchrecipienttypedetails-property-values-through-the-adsi-ldap-provider-ole-db</link>
      <pubDate>Wed, 08 Feb 2012 06:08:00 GMT</pubDate>
      <dc:creator><![CDATA[Sebastian Dau]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dau-blog/2012/02/08/how-do-i-access-msexchrecipienttypedetails-property-values-through-the-adsi-ldap-provider-ole-db/</guid>
      <description><![CDATA[It&rsquo;s been a while since my last Blog post&hellip; I&rsquo;ve been traveling to Seattle to...]]></description>
      <content:encoded><![CDATA[<p>It&rsquo;s been a while since my last Blog post&hellip; I&rsquo;ve been traveling to Seattle to attend my first Microsoft&nbsp; <a href="https://www.facebook.com/TechReady?sk=wall#!/TechReady?sk=wall">TechReady conference.</a></p>
<p>Shortly before I left, one of my colleagues helped me solving a case where a user wrote some VB Script code to access Active Directory Objects using the ADSI LDAP Provider.</p>
<p>That sounds actually more complicated than it is under the covers:</p>
<p>The Active Directory Service Interfaces (ADSI) Lightweight Directory Access Protocol (LDAP) provider implements OLE DB interfaces that allow you to use ActiveX Data Objects (ADO) to access objects in LDAP compliant directories.</p>
<p><a href="https://support.microsoft.com/kb/187529/en-us">Further ADSI details are explained in the KB.</a></p>
<p>One thing that was new to me was how to debug a VB Script using Visual Studio. The answer to this is also pretty simple: just run <strong>cscript.exe //d //x</strong> so that the default debugger gets attached when the script executes.</p>
<p><a href="https://support.microsoft.com/kb/308364/en-us">Further script debugging details are explained in this KB.</a></p>
<p>Anyway the actual customer problem however was a bit tricky so I think it is a good idea to share the solution just in case you run into the same issue yourself sometime.</p>
<p>&nbsp;</p>
<p><strong>Problem: </strong></p>
<p>When accessing the value field of the ado recordset for &ldquo;msExchRecipientTypeDetails&rdquo; just like</p>
<div style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: 'Courier New', courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: #f4f4f4;" id="codeSnippetWrapper">
<div style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: 'Courier New', courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;" id="codeSnippet">
<pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: 'Courier New', courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: #606060;" id="lnum1"> 1:</span> adoRecordSet.Fields(<span style="color: #006080;">"msExchRecipientTypeDetails"</span>).Value</pre>
<!--CRLF--></div>
</div>
<p>The error &ldquo;<strong>object doesn't support this property or method</strong>&rdquo; is thrown even though the debugger watch windows indicates that there seems to be a value of an unknown type.</p>
<p></p>
<p><strong>Cause:</strong></p>
<p>The reason why this happens is because the actual type of the value that is returned is a 64bit integer as documented in</p>
<p><a title="https://msdn.microsoft.com/en-us/library/microsoft.exchange.data.directory.sync.user.msexchrecipienttypedetails(v=exchg.140).aspx" href="https://msdn.microsoft.com/en-us/library/microsoft.exchange.data.directory.sync.user.msexchrecipienttypedetails(v=exchg.140).aspx">https://msdn.microsoft.com/en-us/library/microsoft.exchange.data.directory.sync.user.msexchrecipienttypedetails(v=exchg.140).aspx</a></p>
<p>The script engine seems to marshal such types as IADsLargeInteger Interface as documented in</p>
<p><a title="https://msdn.microsoft.com/en-us/library/aa706037(VS.85).aspx" href="https://msdn.microsoft.com/en-us/library/aa706037(VS.85).aspx">https://msdn.microsoft.com/en-us/library/aa706037(VS.85).aspx</a></p>
<p>&nbsp;</p>
<p><strong>Solution:</strong></p>
<p>This interface has a separate property for the 32bit low and the high part of 64bit value so that you can access it from VBS.</p>
<div style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: 'Courier New', courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: #f4f4f4;" id="codeSnippetWrapper">
<div style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: 'Courier New', courier, monospace; font-size: 8pt; direction: ltr; background-color: #f4f4f4;" id="codeSnippet">
<pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: 'Courier New', courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"><span style="color: #606060;" id="lnum1"> 1:</span> adoRecordSet.Fields(<span style="color: #006080;">"msExchRecipientTypeDetails"</span>).Value.LowPart</pre>
<!--CRLF--></div>
</div>
<p>Hope that helps you tackling your code issue. Feedback is appreciated&hellip;</p>
<p>Good Luck!</p>]]></content:encoded>
    </item>
  </channel>
</rss>