<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>.Net Development</title>
        <link>http://geekswithblogs.net/mhamilton/category/2441.aspx</link>
        <description>Dot Net Developer's topics.</description>
        <language>en-US</language>
        <copyright>Michael J. Hamilton, Sr.</copyright>
        <managingEditor>mike@mjhamilton.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>System.Data.OracleClient vs. Oracle ODP - Not all things .Net</title>
            <link>http://geekswithblogs.net/mhamilton/archive/2007/03/06/108104.aspx</link>
            <description>&lt;P&gt;I recently had the not-so-great-or-fun pleasure of a pure .Net to Oracle application show-down :) And yes, I say that with some pun.&lt;/P&gt;
&lt;P&gt;In summary, keeping to proper form, I developed a DataProviderFactory that provided the following:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;SQL Server native client API&lt;/LI&gt;
&lt;LI&gt;Oracle&lt;/LI&gt;
&lt;LI&gt;BDC to SQL Server&lt;/LI&gt;
&lt;LI&gt;BDC to Oracle&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Now, BDC = Business Data Catalog - a new service provider native to MOSS (Micrsoft Office SharePoint Server) 2007. And trust me - the BDC ROCKS!!!&lt;/P&gt;
&lt;P&gt;Back to providers.&lt;/P&gt;
&lt;P&gt;My provider factory basically provided classes for base types and class bases - the lowest level. In the solution I coded specific classes for the given provider (Oracle, SQL, etc) and within the Assembly.cs for that class - I'd reference the appropriate base class. All run-of-the-mill best practice stuff. Right? Well, almost.&lt;/P&gt;
&lt;P&gt;After several hours of seeing varrying results from the Oracle database, I began to get a little suspicious - and sure enough - the provider with .Net is not all things .Net - at least not for Oracle.&lt;/P&gt;
&lt;P&gt;If you are coding for a Oracle specific application&amp;nbsp;- check out this &lt;A href="http://www.oracle.com/technology/tech/windows/odpnet/index.html"&gt;link&lt;/A&gt;&amp;nbsp;for specifics on the Oracle Data Provider for .Net - or the ODP. The API is 'similar' - but only SIMILAR - it is not the same. I invariably tore out the .Net System.Data.OracleClient and replaced it with the Oracle .Net provider and all came together - but this was not obvious or intuitive. &lt;/P&gt;
&lt;P&gt;HTH's another weary developer struggling to sort out why - for lack of a better way to say it - when dealing with Oracle - it's not all things .Net.&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=108104"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=108104" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/mhamilton/aggbug/108104.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michael J. Hamilton, Sr.</dc:creator>
            <guid>http://geekswithblogs.net/mhamilton/archive/2007/03/06/108104.aspx</guid>
            <pubDate>Tue, 06 Mar 2007 16:10:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/mhamilton/comments/108104.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/mhamilton/archive/2007/03/06/108104.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/mhamilton/comments/commentRss/108104.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/mhamilton/services/trackbacks/108104.aspx</trackback:ping>
        </item>
        <item>
            <title>Microsoft Office SharePoint Server (MOSS) 2007 - Configuration / Setup - Login failed for user ''. The user is not associated with a trusted SQL Server configuration.</title>
            <link>http://geekswithblogs.net/mhamilton/archive/2007/02/11/106024.aspx</link>
            <description>&lt;P&gt;After installing MOSS and launching the SharePoint Configuration Wizard (psconfig.exe) - you are ready to begin the last leg of your MOSS installation/setup.&lt;/P&gt;
&lt;P&gt;Here you provide the setup with the particualars for your server. Often you are installing MOSS with SQL Server being remote from MOSS, and you will be using a domain-level service account for the installation. The following is an example of the data you might enter during this step:&lt;/P&gt;
&lt;P&gt;(if the pic does not show - click &lt;A href="MOSS Config Wiz Setup" temp_href="MOSS Config Wiz Setup"&gt;here&lt;/A&gt;)&lt;/P&gt;
&lt;P&gt;&lt;A href="file:///C:/Documents%20and%20Settings/mjhs/Application%20Data/Windows%20Live%20Writer/PostSupportingFiles/b673d817-886a-4995-868d-89b97c152419/clip_image002[4][6].jpg" atomicSelection="true"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=489 src="file:///C:/Documents%20and%20Settings/mjhs/Application%20Data/Windows%20Live%20Writer/PostSupportingFiles/b673d817-886a-4995-868d-89b97c152419/clip_image002[4]_thumb[1].jpg" width=574 border=0&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Here you have a named instance of SQL Server - HAMPDOCNC running on a machine named HAMDC02.&lt;/P&gt;
&lt;P&gt;You have a service account - $ervice_MossSa - that is a domain-level account running on the HAMILTON domain.&lt;/P&gt;
&lt;P&gt;You click NEXT and you get the following:&lt;/P&gt;
&lt;P&gt;(if the pic doesn't show - click &lt;A href="http://geekswithblogs.net/mhamilton/gallery/image/3724.aspx"&gt;here&lt;/A&gt;)&lt;/P&gt;
&lt;P&gt;&lt;A href="file:///C:/Documents%20and%20Settings/mjhs/Application%20Data/Windows%20Live%20Writer/PostSupportingFiles/b673d817-886a-4995-868d-89b97c152419/clip_image002[1][7].jpg" atomicSelection="true"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=118 src="file:///C:/Documents%20and%20Settings/mjhs/Application%20Data/Windows%20Live%20Writer/PostSupportingFiles/b673d817-886a-4995-868d-89b97c152419/clip_image002[1]_thumb[2].jpg" width=636 border=0&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;There are a number of reasons you can get this message. In short, if you review the 3rd to last ERR entry in the PCSDiagnostics (latest one) in \Program Files\Common Files\Microsoft Shared\web server extensions\12\LOGS - you'll see the above titled error - followed by a slew of other highly technical dump mumbo jumbo.&lt;/P&gt;
&lt;P&gt;The gist is - the account is not getting passed to SQL Server. Why?&lt;/P&gt;
&lt;P&gt;When you Google and otherwise research this error - it more often is associated with trying to connect to SQL Server from a ASP.Net application - but this is not the case here.&lt;/P&gt;
&lt;P&gt;Here are a couple of obvious things to check if you receive this message:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Ensure that the Surface Area Configuration for SQL Server has been run on the host SQL Server - and that remote connections are allowed and that the transport of both TCP/IP and Named Pipes has been set. 
&lt;LI&gt;Ensure that Enable Network DTC has been configured on both the SQL Server and any/all MOSS host servers.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Finally, be sure you reboot the MOSS host after setting up the Enable Network DTC&lt;/P&gt;
&lt;P&gt;HTH's...&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=106024"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=106024" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/mhamilton/aggbug/106024.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michael J. Hamilton, Sr.</dc:creator>
            <guid>http://geekswithblogs.net/mhamilton/archive/2007/02/11/106024.aspx</guid>
            <pubDate>Sun, 11 Feb 2007 15:45:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/mhamilton/comments/106024.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/mhamilton/archive/2007/02/11/106024.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/mhamilton/comments/commentRss/106024.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/mhamilton/services/trackbacks/106024.aspx</trackback:ping>
        </item>
        <item>
            <title>Developing with Visual Studio on a Vista Workstation</title>
            <link>http://geekswithblogs.net/mhamilton/archive/2007/01/12/103485.aspx</link>
            <description>&lt;P&gt;As Vista gains momentum, and many of us get our hands on it - we're quickly faced with a question that not many seem able to answer. More disconcerting - there is nothing solid out there to provide direction.&lt;/P&gt;
&lt;P&gt;If I am a ASP.Net developer - I want IIS available for my development pleasure. &lt;/P&gt;
&lt;P&gt;More important, I will probably be using Visual Studio to crank out my applications.&lt;/P&gt;
&lt;P&gt;There is a lot of effort in the launch of Vista and the new Office products - but what about the development community? Especially if we're not one of the few that can afford to travel the globe and partake of the special developer launches sponsored by MSFT?&lt;/P&gt;
&lt;P&gt;A good start is &lt;A href="http://msdn2.microsoft.com/en-us/vstudio/aa948853.aspx"&gt;here&lt;/A&gt;&amp;nbsp;for the latest developments regarding Visual Studio and Vista. Pay special attention to that one line about VS .Net 2002 and 2003 not being supported on Vista! This is very important to many in the development community.&lt;/P&gt;
&lt;P&gt;Be sure to get up to speed on the &lt;A href="http://msdn.microsoft.com/vstudio/support/vs2005sp1/default.aspx"&gt;Visual Studio SP1&lt;/A&gt;&amp;nbsp;release. A touted 70+ enhancements, including:&lt;/P&gt;
&lt;LI&gt;New processor support (e.g., Core Duo) for code generation and profiling 
&lt;LI&gt;Performance and scale improvements in Team Foundation Server 
&lt;LI&gt;Team Foundation Server integration with Excel 2007 and Project 2007 
&lt;LI&gt;Tool support for occasionally connected devices and SQL Server Compact Edition 
&lt;LI&gt;Additional support for project file based Web applications 
&lt;LI&gt;Windows Embedded 6.0 platform and tools support &lt;/LI&gt;
&lt;P&gt;Yes, MSFT announced a SP1 for Vista, covered pretty decent &lt;A href="http://www.adtmag.com/article.aspx?id=19845"&gt;here&lt;/A&gt;&amp;nbsp;but you should know that this release is beta. The official release will not appear until RTM Vista is launched in January/February this year.&lt;/P&gt;
&lt;P&gt;Planning automated deployments of Visual Studio on Vista workstations? Be sure to review &lt;A href="http://www.adtmag.com/article.aspx?id=19845"&gt;this&lt;/A&gt; blog on some issues identified early on. The honeymoon is over!&lt;/P&gt;
&lt;P&gt;Be sure to check out the latest &lt;A href="http://msdn2.microsoft.com/en-us/vstudio/aa948852.aspx"&gt;pod casts&lt;/A&gt;&amp;nbsp;that highlight the latest Visual Studio tools / technologies / direction.&lt;/P&gt;
&lt;P&gt;As I ramp up to start doing all of my development on Vista - I'll keep you posted on the pitfalls and niceties - if they're to be found!&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=103485"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=103485" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/mhamilton/aggbug/103485.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michael J. Hamilton, Sr.</dc:creator>
            <guid>http://geekswithblogs.net/mhamilton/archive/2007/01/12/103485.aspx</guid>
            <pubDate>Sat, 13 Jan 2007 00:34:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/mhamilton/comments/103485.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/mhamilton/archive/2007/01/12/103485.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/mhamilton/comments/commentRss/103485.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/mhamilton/services/trackbacks/103485.aspx</trackback:ping>
        </item>
        <item>
            <title>The IIS Admin Service service terminated with service-specific error 2149648394 (0x8021080A).</title>
            <link>http://geekswithblogs.net/mhamilton/archive/2006/12/13/101055.aspx</link>
            <description>&lt;P&gt;&lt;STRONG&gt;The IIS Admin Service service terminated with service-specific error 2149648394 (0x8021080A).&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;IIS Admin Service goes away after restoring a VHD / VPC Server&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I recently had the unexpected pleasure of losing my IIS Admin server - altogether!!! Translate - 150% !!!&lt;/P&gt;
&lt;P&gt;Now, before this - everything was going great - except. During an upgrade of MOSS (Microsoft Office SharePoint Server) I encounted an issue that forced me to restore a VPC image - essentially bringing over another copy of the VHD and firing the server back up.&lt;/P&gt;
&lt;P&gt;Interstingly, during that reboot - which for all intents should have gone fine - I see a hoard of DSKCHK processes running. Invariably, something got out of wack on the NTFS volumn between my shutting the image down and bringing it back up. During the 'fixing' process - a number of files invaribly can become corrupt - and the Metabase.xml - the blood-life of your IIS Admin service - is no exception. SO&lt;/P&gt;
&lt;P&gt;Check in C:\Windows\System32\Inetsrv and you'll find a 'History' folder. Within here - hopefully - you'll find fairly recent backups of the Metabase.XML and MBSchema.XML objects. Before doing the following - be sure to backup the existing Metabase.xml and MBSchema.xml from C:\Windows\System32\Inetsrv first.&lt;/P&gt;
&lt;P&gt;Now, rename a recent backup from the 'History' folder - renaming a recently Metabase.XML object, and then a recent MBSchema.XML object. Copy / Paste each of these to the C:\Windows\System32\Inetsrv.&lt;/P&gt;
&lt;P&gt;Ahh, not quite done.&lt;/P&gt;
&lt;P&gt;Now do a IISRESET from a command prompt.&lt;/P&gt;
&lt;P&gt;Hopefully this will get you back to where you need to be.&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=101055"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=101055" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/mhamilton/aggbug/101055.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michael J. Hamilton, Sr.</dc:creator>
            <guid>http://geekswithblogs.net/mhamilton/archive/2006/12/13/101055.aspx</guid>
            <pubDate>Wed, 13 Dec 2006 21:16:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/mhamilton/comments/101055.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/mhamilton/archive/2006/12/13/101055.aspx#feedback</comments>
            <slash:comments>55</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/mhamilton/comments/commentRss/101055.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/mhamilton/services/trackbacks/101055.aspx</trackback:ping>
        </item>
        <item>
            <title>Visual Studio Team System - Visual Studio code-name "Orcas"</title>
            <link>http://geekswithblogs.net/mhamilton/archive/2006/11/04/96131.aspx</link>
            <description>&lt;P&gt;&lt;STRONG&gt;Visual Studio Team System - Visual Studio code-name "Orcas"&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;If you are heavy into .Net development and Visual Studio (VS) - you are already aware of VS's rich IDE and are probably familiar with some, if not many of the VS extensions, like Tools for Office (VSTO) and integration with other products like BizTalk and the Windows Workflow Foundation (&lt;A href="http://msdn.microsoft.com/msdnmag/issues/06/03/CuttingEdge/"&gt;get an intro to WWF and how to use it&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;So what is Orcas? In a word, the latest offering for Vista and the 2007 Office System development platform.&lt;/P&gt;
&lt;P&gt;Read the roadmap &lt;A href="http://msdn.microsoft.com/vstudio/future/default.aspx"&gt;here&lt;/A&gt;. You have been hearing about the new features in Vista and &lt;A href="http://geekswithblogs.net/mhamilton/archive/2006/11/04/96128.aspx"&gt;.Net 3.0&lt;/A&gt;&amp;nbsp;- the &lt;A href="http://msdn2.microsoft.com/en-us/netframework/aa663300.aspx"&gt;Windows Presentation Foundation&lt;/A&gt;, the &lt;A href="http://msdn2.microsoft.com/en-us/netframework/aa663299.aspx"&gt;Windows Communication Foundation&lt;/A&gt;, and the &lt;A href="http://msdn2.microsoft.com/en-us/netframework/aa663308.aspx"&gt;Windows Workflow Foundation&lt;/A&gt;. Get ready for the tools to help you leverage these new extensions of the .Net Framework - and much more!&lt;/P&gt;
&lt;P&gt;Learn more about how you can help &lt;EM&gt;&lt;A href="http://msdn.microsoft.com/windowsvista/experience/"&gt;create the experience&lt;/A&gt;&lt;/EM&gt; for your customers, and leverage the latest in developer technologies.&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=96131"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=96131" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/mhamilton/aggbug/96131.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michael J. Hamilton, Sr.</dc:creator>
            <guid>http://geekswithblogs.net/mhamilton/archive/2006/11/04/96131.aspx</guid>
            <pubDate>Sat, 04 Nov 2006 21:35:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/mhamilton/comments/96131.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/mhamilton/archive/2006/11/04/96131.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/mhamilton/comments/commentRss/96131.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/mhamilton/services/trackbacks/96131.aspx</trackback:ping>
        </item>
        <item>
            <title>IronPython - Microsoft IronPython - The revitalization of a great language - Python</title>
            <link>http://geekswithblogs.net/mhamilton/archive/2006/11/04/96129.aspx</link>
            <description>&lt;P&gt;IronPython, Microsoft's answer to my own and many other developer's request for a serious language for ASP.Net development - is gaining momentum and that's a great thing.&lt;/P&gt;
&lt;P&gt;Those familiar with &lt;A href="http://www.python.org/"&gt;Python&lt;/A&gt;&amp;nbsp;are aware of the power the language provides. A true, object oriented programming (OOP) language, Python is an open source initiative that has been widely adopted and it runs on a host of different platforms / operating systems (OS's).&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.asp.net/ironpython/default.aspx?tabid=62"&gt;IronPython&lt;/A&gt;&amp;nbsp;is a new flavor of Python that runs on .Net providing integration with all .Net libraries and making the language even more attractive - especially to existing ASP.Net developers.&lt;/P&gt;
&lt;P&gt;Check out this &lt;A href="http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20051110PythonJH/manifest.xml"&gt;webcast&lt;/A&gt;&amp;nbsp;for an introduction, and be sure to visit the IronPython site for details on how to get started. &lt;/P&gt;
&lt;P&gt;If you are familiar with IronPython, you can download the latest bits &lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyId=55932211-0D7E-4C6E-9B18-8F9D2AC1EE43&amp;amp;displaylang=en"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=96129"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=96129" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/mhamilton/aggbug/96129.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michael J. Hamilton, Sr.</dc:creator>
            <guid>http://geekswithblogs.net/mhamilton/archive/2006/11/04/96129.aspx</guid>
            <pubDate>Sat, 04 Nov 2006 21:02:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/mhamilton/comments/96129.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/mhamilton/archive/2006/11/04/96129.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/mhamilton/comments/commentRss/96129.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/mhamilton/services/trackbacks/96129.aspx</trackback:ping>
        </item>
        <item>
            <title>Microsoft .Net 3.0 Framework - What is .Net 3.0 and what is new?</title>
            <link>http://geekswithblogs.net/mhamilton/archive/2006/11/04/96128.aspx</link>
            <description>&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Microsoft .Net 3.0 Framework - What is .Net 3.0 and what is new?&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;As a developer in the field, I am asked periodically about one new technology or another. And these days, I am overwhelmed with questions about MOSS and Vista. Occassionally, I am asked about the new development tools and frameworks - and .Net 3.0 is a hot topic.&lt;/P&gt;
&lt;P&gt;So, what's new in .Net 3.0? In a word - a lot! &lt;/P&gt;
&lt;P&gt;Is .Net 2.0 being replaced? Are my previous and current development efforts going to require re-work? No, .Net 2.0 is not being replaced, and no you will not have to re-work existing .Net 2.0 applications. The .Net 3.0 is an extension of the current .Net 2.0 Framework - not a re-write or upgrade.&lt;/P&gt;
&lt;P&gt;Please review &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/intronetfx30.asp"&gt;Microsoft's&lt;/A&gt; overview of the technology, and get a handle on where we're going.&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=96128"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=96128" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/mhamilton/aggbug/96128.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michael J. Hamilton, Sr.</dc:creator>
            <guid>http://geekswithblogs.net/mhamilton/archive/2006/11/04/96128.aspx</guid>
            <pubDate>Sat, 04 Nov 2006 20:49:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/mhamilton/comments/96128.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/mhamilton/archive/2006/11/04/96128.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/mhamilton/comments/commentRss/96128.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/mhamilton/services/trackbacks/96128.aspx</trackback:ping>
        </item>
        <item>
            <title>NewSID - and the Future of SysInternals</title>
            <link>http://geekswithblogs.net/mhamilton/archive/2006/09/12/90939.aspx</link>
            <description>&lt;P&gt;I recenlty had a question about a link I have had for NewSID on my blog regarding re-SIDing a VM or server OS in general.&lt;/P&gt;
&lt;P&gt;I sincerely apologize for not keeping up with the times.&lt;/P&gt;
&lt;P&gt;This &lt;A href="http://www.sysinternals.com/Blog/"&gt;link&lt;/A&gt;&amp;nbsp;will convey what is going on - basically, the guys that have been a great help for us at SysInternals - well, they've gone internal!!!&lt;/P&gt;
&lt;P&gt;My hat is off to them - many congratulations.&lt;/P&gt;
&lt;P&gt;Now, who wants to host an FTP link to NewSID??? :)&lt;/P&gt;
&lt;P&gt;I'll see if I can get permission to do that.&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=90939"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=90939" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/mhamilton/aggbug/90939.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michael J. Hamilton, Sr.</dc:creator>
            <guid>http://geekswithblogs.net/mhamilton/archive/2006/09/12/90939.aspx</guid>
            <pubDate>Tue, 12 Sep 2006 13:28:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/mhamilton/comments/90939.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/mhamilton/archive/2006/09/12/90939.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/mhamilton/comments/commentRss/90939.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/mhamilton/services/trackbacks/90939.aspx</trackback:ping>
        </item>
        <item>
            <title>Chip Head / Code Junkie / Technical Support / Blogs / News Group Support / Another day in paradise :)</title>
            <link>http://geekswithblogs.net/mhamilton/archive/2006/07/15/85321.aspx</link>
            <description>&lt;P&gt;So who is Michael J. Hamilton, Sr.? Candidly? I still don't know :)&lt;/P&gt;
&lt;P&gt;Over a quarter century ago my wife joked that she was going to marry me, we'd have 10 children and live happily ever after.&lt;/P&gt;
&lt;P&gt;Today? We have 9 children, 5 grandchildren, and I still can't get enough of coding!!! Yea, I know - I lost it a long time ago :)&lt;/P&gt;
&lt;P&gt;I cut my teeth with the Apple II series some 22 years ago. I wound up working for Apple on the design of the UCSD (Unversity of So. Cal/San Diego) Pascal firmware, as well as firmware and OS pieces for the Apple IIGS. It really was a fun time - and certainly, those were the days!!! Alas, larger processors, and Microsoft. (I didn't say that.)&lt;/P&gt;
&lt;P&gt;Today I enjoy the mild-mannered 8-10 hour days as a Software Architect and I get to play with most of the latest/greatest toys from MSFT.&lt;/P&gt;
&lt;P&gt;At night I turn/burn in a frenzy to get my fix - writing code!!! I still love stemming out web sites, coding custom e-commerce applications, and plain and simple - WRITING CODE!!!&lt;/P&gt;
&lt;P&gt;Revisiting my blog - which I've only been doing a little over a year now; visiting both the beta and public newsgroups for one product or another, and still trying to find time to be dad - well - in a word, I do not have a dotfuscator for that yet. But I'm working on it!&lt;/P&gt;
&lt;P&gt;To all of those in the community that spend your time doing the same, I want to say thank you - and I mean that sincerely. I would not be where I am today if it were not for the many people just like myself that take the time to post their adventures. I have worked with 1 of the best organizations in the world insofar as teamwork and support goes, and I can also say that a great extension of that teamwork is the network of people I have met here and in many other - blogs. &lt;/P&gt;
&lt;P&gt;Please keep up the great work - and know that you really are appreciated.&lt;/P&gt;
&lt;P&gt;MikeH... Another Geek In Need... :)&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=85321"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=85321" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/mhamilton/aggbug/85321.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michael J. Hamilton, Sr.</dc:creator>
            <guid>http://geekswithblogs.net/mhamilton/archive/2006/07/15/85321.aspx</guid>
            <pubDate>Sun, 16 Jul 2006 01:47:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/mhamilton/comments/85321.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/mhamilton/archive/2006/07/15/85321.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/mhamilton/comments/commentRss/85321.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/mhamilton/services/trackbacks/85321.aspx</trackback:ping>
        </item>
        <item>
            <title>.Net Directory Services Programming - C# - Part 3</title>
            <link>http://geekswithblogs.net/mhamilton/archive/2006/07/15/85303.aspx</link>
            <description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;U&gt;.Net Directory Services Programming &amp;#8211; C# - Part 3&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/U&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;U&gt;&lt;o:p&gt;&lt;SPAN style="TEXT-DECORATION: none"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/o:p&gt;&lt;/U&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Topics&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;DirectorySearcher &amp;#8211; the other critical class in the DirectoryServices namespace.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Review&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Because a lot of your Directory Services (DS) development will involve querying DS for data, it makes sense that this is a powerful class offered in the namespace, and below are some of the features:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: list .5in; mso-list: l0 level1 lfo1"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;DirectorySearcher&lt;/B&gt; &amp;#8211; Performs the initial queries against AD&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: list .5in; mso-list: l0 level1 lfo1"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;SearchResult&lt;/B&gt; &amp;#8211; A single object reference from a search performed by &lt;I style="mso-bidi-font-style: normal"&gt;DirectorySearcher&lt;/I&gt;&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: list .5in; mso-list: l0 level1 lfo1"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;ResultPropertyCollection&lt;/B&gt; &amp;#8211; A collection of properties of the &lt;I style="mso-bidi-font-style: normal"&gt;SearchResult&lt;/I&gt; instance&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: list .5in; mso-list: l0 level1 lfo1"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;ResultPropertyValueCollection &lt;/B&gt;&amp;#8211; The values of properties in a &lt;I style="mso-bidi-font-style: normal"&gt;SearchResult&lt;/I&gt; instance.&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: list .5in; mso-list: l0 level1 lfo1"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;SearchResultCollection&lt;/B&gt; &amp;#8211; Basically a collection of &lt;I style="mso-bidi-font-style: normal"&gt;SearchResult&lt;/I&gt; instances returned from a query by &lt;I style="mso-bidi-font-style: normal"&gt;DirectorySearcher&lt;/I&gt;&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: list .5in; mso-list: l0 level1 lfo1"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;SortOption&lt;/B&gt; &amp;#8211; Allows a means to sort a result set.&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;We have briefly touched on DS by introducing some basic DirectoryEntry information and a couple simple examples, and we have introduced some basic properties and examples on how to interact with those.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;I have not taken a lot of time to review a directory structure &amp;#8211; basically assuming that you should have some of this understanding already. As I delve into the next lesson, this assumption holds fast. If you have any issues or are dealing with something that I am not elaborating enough on, please feel free to email me directly at (mikeh AT thedataworks.net) and I will respond as quickly as I can. Please forgive the notation there &amp;#8211; but we all are familiar with the latest in SPAM bots and whatnot.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Show me the Money!!!&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Or at least the code. Lets get started&amp;#8230;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Parent &amp;#8211; Child Relationships&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;DirectoryEntry objects (DE&amp;#8217;s) can be a root object in AD, or an object within another &amp;#8211; hence, a child object of another. We reviewed in Part 1 a few of the common references to object types (CN, &lt;?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /&gt;&lt;st1:place w:st="on"&gt;&lt;st1:City w:st="on"&gt;OU&lt;/st1:City&gt;, &lt;st1:State w:st="on"&gt;DC&lt;/st1:State&gt;&lt;/st1:place&gt;). These are the most prevalent you will deal with.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;DC is the root level context. OU&amp;#8217;s can be off the root, or a child of other OU&amp;#8217;s and even Containers. CN&amp;#8217;s can be off the root, within OU&amp;#8217;s and often are found within Containers.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;A word about Containers and Security&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;When planning your DS application, keep this in mind: Containers are non-secure objects! Let me explain. AD security is multi-faceted, yes, but the real security is managed using Group Policy (something we are not going to review here). &lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Containers are basically folders in your directory tree. AD comes with a couple by default. If you promote a server and check your directory tree, you&amp;#8217;ll find a Users, a Built-In, and a couple other folders off the root tree (or context/server name) object. These are &lt;I style="mso-bidi-font-style: normal"&gt;not&lt;/I&gt; OU&amp;#8217;s &amp;#8211; they are containers.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Group Policy (GP) cannot be applied to a Container object in AD. You can apply GP to objects within Containers &amp;#8211; depending on what those objects are &amp;#8211; but not the Container itself. This is important because a lot of administration can be simplified by applying the GP to the entire Container. So if not the Container, then what? Organizational Units &amp;#8211; OU&amp;#8217;s. Alas, OU&amp;#8217;s are going to be your preferred &lt;I style="mso-bidi-font-style: normal"&gt;folder&lt;/I&gt; or &lt;I style="mso-bidi-font-style: normal"&gt;container&lt;/I&gt; (for lack of a better way to put it) for object storage.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Basic Searches&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;In Part 1 we introduced a server name and basic OU&amp;#8217;s. To re-cap that:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Server:&lt;/B&gt; developer.hamilton.com&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;OU=Accounts&lt;/B&gt; &amp;#8211; off the root of developer.hamilton.com&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;OU=Developers&lt;/B&gt; &amp;#8211; within the OU=Accounts&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;CN=Mike Hamilton&lt;/B&gt; &amp;#8211; within the OU=Developers&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Within the OU=Accounts I might also create &lt;I style="mso-bidi-font-style: normal"&gt;service accounts&lt;/I&gt; &amp;#8211; basic user accounts that are used to run services such as IIS Application Pools, SQL Server, or other server / service applications. I might also have OU&amp;#8217;s that represent other departments that pertain to development: BA&amp;#8217;s for the Business Analyst, QA&amp;#8217;s, etc. You can nest OU&amp;#8217;s and accounts in just about any way you want to. NOTE: In AD &amp;#8211; if you have not already &amp;#8211; you will run into one of the inherent limitations of the AD Users &amp;amp; Computers (dsa.msc) snap-in: It can only display the first 2,000 objects within a Container or OU. So if you anticipate a large volume of users for a system you are designing, keep this in mind. You will want to present 1) a more suitable customized user interface piece for administration of this DS, or 2) design your object hierarchy so that users are more spread out within the DS. I will touch base on this topic in a later Part and introduce a couple ideas for addressing this limitation.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;DirectorySearcher&lt;/B&gt; and the &lt;B style="mso-bidi-font-weight: normal"&gt;SearchResult&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;When using the DirectorySearcher class, you have the &lt;B style="mso-bidi-font-weight: normal"&gt;FindOne()&lt;/B&gt; and &lt;B style="mso-bidi-font-weight: normal"&gt;FindAll()&lt;/B&gt; methods that build your result set. As they infer, one finds one occurrence, the other finds all occurrences.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Let&amp;#8217;s say I had more than one Mike on my team, and I wanted to find all entries that began with &lt;I style="mso-bidi-font-style: normal"&gt;Mike&lt;/I&gt;?&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;DirectoryEntry rootEntry = new DirectoryEntry();&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// Binds root context&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;// Now find every CN that has Mike at the beginning of the name&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;DirectorySearcher searcherResults = new DirectorySearcher(rootEntry,&amp;#8221;(CN=Mike*)&amp;#8221;);&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;This is a simple example, and the result set will be one or more object references that begin with Mike. Notice that I did a bind on the root of the DS. I could have narrowed the focus of the search to only the developer&amp;#8217;s OU by doing the following:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;DirectoryEntry developersEntry = new DirectoryEntry(&amp;#8220;LDAP://developer.hamilton.com/OU=Accounts,OU=Developers,DC=developer,DC=&lt;st1:place w:st="on"&gt;&lt;st1:City w:st="on"&gt;hamilton&lt;/st1:City&gt;,&lt;st1:State w:st="on"&gt;DC&lt;/st1:State&gt;&lt;/st1:place&gt;=com&amp;#8221;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;This would return an entry object where the parent would be the OU=Developers, and not the default root of the DS tree.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Lets say my DS was structured like the following:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;developer.hamilton.com&lt;/B&gt; &lt;SPAN style="FONT-FAMILY: Wingdings; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&amp;#224;&lt;/SPAN&gt;&lt;/SPAN&gt; root of the DS&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;OU=Accounts&lt;/B&gt; &lt;SPAN style="FONT-FAMILY: Wingdings; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&amp;#224;&lt;/SPAN&gt;&lt;/SPAN&gt; First OU of accounts of users.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;OU=Developers&lt;/B&gt; &lt;SPAN style="FONT-FAMILY: Wingdings; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&amp;#224;&lt;/SPAN&gt;&lt;/SPAN&gt; Key development personnel&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;OU=Bas&lt;/B&gt; &lt;SPAN style="FONT-FAMILY: Wingdings; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&amp;#224;&lt;/SPAN&gt;&lt;/SPAN&gt; Business Analyst&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;OU=QA&lt;/B&gt; &lt;SPAN style="FONT-FAMILY: Wingdings; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&amp;#224;&lt;/SPAN&gt;&lt;/SPAN&gt; Quality Assurance / Test personnel&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;OU=Users&lt;/B&gt; &lt;SPAN style="FONT-FAMILY: Wingdings; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&amp;#224;&lt;/SPAN&gt;&lt;/SPAN&gt; General users on this server.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Now, we want to find all users that are in the &lt;B style="mso-bidi-font-weight: normal"&gt;Users&lt;/B&gt; OU, not returning the developers or other personnel within the directory. That&amp;#8217;s pretty straight forward.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;DirectoryEntry developersEntry = new DirectoryEntry(&amp;#8220;LDAP://developer.hamilton.com/OU=Accounts,OU=Users,DC=developer,DC=&lt;st1:place w:st="on"&gt;&lt;st1:City w:st="on"&gt;hamilton&lt;/st1:City&gt;,&lt;st1:State w:st="on"&gt;DC&lt;/st1:State&gt;&lt;/st1:place&gt;=com&amp;#8221;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;// Now return all users in this OU&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;DirectorySearcher searcherResults = new DirectorySearcher(rootEntry,&amp;#8221;(CN= *)&amp;#8221;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;As you get more familiar with DS programming, you will find there are other ways to accomplish the same result &amp;#8211; I am simply trying to open those doors for you.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;It is important that you understand how to narrow your search filter in this way because you will find it greatly improves the performance of your application when you know where to search for content and you keep your search filter narrowly defined. For example, if I have 15,000 employees, they would very likely be grouped in AD by their department, and possibly further grouped by sub-departments. I would want to know this information beforehand so I can plan my DS application to be as efficient as possible. I would not want to search the rootDSE each time for a given employee or group of employees, if I know the departments those employees are in.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;More on the Search Filter&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;The &lt;I style="mso-bidi-font-style: normal"&gt;filter&lt;/I&gt; is a LDAP string that allows you to search for objects based on specific criteria. You will also use relational operators to better refine your search. The following list those operators:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;=&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Equal to&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;~=&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Is &lt;I style="mso-bidi-font-style: normal"&gt;approximately&lt;/I&gt; equal to (or like)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&amp;lt;=&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Less than or equal to&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&amp;gt;=&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Greater than or equal to&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="COLOR: blue"&gt;NOTE: You cannot use &amp;#8216;&amp;lt;&amp;#8217; or &amp;#8216;&amp;gt;&amp;#8217; individually in LDAP &amp;#8211; you must use the notation &amp;lt;= or &amp;gt;=.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;The * character works as a wildcard in your search, as in the example above we searched for CN=Mike* or CN=* - in this case, get all Canonical (common) Names beginning with Mike, or get all names period (respectively).&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;To find all users with a surname of Hamilton you would use&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;(sn = Hamilton)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;To find all users where the email ends in @hamilton.com&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;(&amp;amp;(objectCategory = person) (objectClass = user) (mail = &lt;A href="mailto:*@hamilton.com)"&gt;&lt;SPAN style="TEXT-DECORATION: none; text-underline: none"&gt;*@hamilton.com)&lt;/SPAN&gt;&lt;/A&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Notice the Polish notation used here &amp;#8211; the operator comes before the condition. LDAP uses this notation in the Filter. The above example would be more familiar possibly as&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;(objectCategory = person) AND (objectClass = user) AND (mail = &lt;A href="mailto:*@hamilton.com"&gt;&lt;SPAN style="TEXT-DECORATION: none; text-underline: none"&gt;*@hamilton.com&lt;/SPAN&gt;&lt;/A&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;The following are allowed logical operators:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&amp;amp;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;AND&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;|&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;OR&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;!&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;NOT&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;You set the &lt;I style="mso-bidi-font-style: normal"&gt;filter&lt;/I&gt; for a search using the DirectorySearcher.Filter property. The following code will create a binding to the root context, and return everything from the root down:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;DirectoryEntry rootEntry = new DirectoryEntry();&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// Binds root context&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;DirectorySearcher rootSearcher = new DirectorySearcher(rootEntry);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Let&amp;#8217;s say we have a binding to the rootDSE as above, but only want to return all users with a surname of Hamilton? Change the DirectorySearcher to the following:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;DirectorySearcher rootSearcher = new DirectorySearcher(&amp;#8220;(sn=Hamilton)&amp;#8221;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;You can either pass the DirectoryEntry object, or you can specify a filter in this fashion when creating a DirectorySearcher instance.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Loading Specific Properties&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;By default, when you create a DirectorySearcher instance, you return &lt;I style="mso-bidi-font-style: normal"&gt;all&lt;/I&gt; properties for that binding (which can be a lot of data if you have a lot of items in your returned result set).&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;You can refine your result set by specifying the exact properties to be returned. This is especially important when you could be returning large collections of users.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Following the above example I could create my rootSearcher and then do:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;rootSearcher.PropertiesToLoad.Add(&amp;#8220;name&amp;#8221;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;rootSearcher.PropertiesToLoad.Add(&amp;#8220;sn&amp;#8221;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;rootSearcher.PropertiesToLoad.Add(&amp;#8220;mail&amp;#8221;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;rootSearcher.PropertiesToLoad.Add(&amp;#8220;telephoneNumber&amp;#8221;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Here I have specifically limited the result set to only include the &lt;I style="mso-bidi-font-style: normal"&gt;name, sn (surname), mail and telephoneNumber&lt;/I&gt; properties.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Finally, when we define our searcher, we can stipulate the &lt;I style="mso-bidi-font-style: normal"&gt;search scope&lt;/I&gt;. &lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Search Scope&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;The search scope determines the extent of the search in a directory, defaulting to beginning at the &lt;I style="mso-bidi-font-style: normal"&gt;root&lt;/I&gt;. &lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;In the &lt;B style="mso-bidi-font-weight: normal"&gt;System.DirectoryServices.SearchScope&lt;/B&gt; you will find the following 3 enumerations specified:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Base&lt;/B&gt; &amp;#8211; Limits the scope to the base, or only 1 object.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;OneLevel&lt;/B&gt; &amp;#8211; Searches 1 level of the immediate child objects, excluding the base object.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Subtree&lt;/B&gt; &amp;#8211; Searches all child objects under the base object, including the base object.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;When creating a DirectorySearcher instance, the following table lists &lt;I style="mso-bidi-font-style: normal"&gt;default&lt;/I&gt; constructor behaviors:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-yfti-tbllook: 1184" cellSpacing=0 cellPadding=0 border=1&gt;
&lt;TBODY&gt;
&lt;TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes"&gt;
&lt;TD style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: black 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 2.05in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1" vAlign=top width=197&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;PROPERTY&lt;o:p&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: black 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #eeeeee; WIDTH: 2.05in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1" vAlign=top width=197&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;DEFAULT VALUE&lt;o:p&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: black 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #eeeeee; WIDTH: 2.05in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1" vAlign=top width=197&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;DESCRIPTION&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 1"&gt;
&lt;TD style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #eeeeee; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 2.05in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1" vAlign=top width=197&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;SearchRoot&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #eeeeee; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #eeeeee; WIDTH: 2.05in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; mso-border-bottom-themecolor: text1; mso-border-right-themecolor: text1" vAlign=top width=197&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Null&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #eeeeee; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #eeeeee; WIDTH: 2.05in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; mso-border-bottom-themecolor: text1; mso-border-right-themecolor: text1" vAlign=top width=197&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Searches the root of the domain controller (rootDSE).&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 2"&gt;
&lt;TD style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #eeeeee; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 2.05in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1" vAlign=top width=197&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Filter&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #eeeeee; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #eeeeee; WIDTH: 2.05in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; mso-border-bottom-themecolor: text1; mso-border-right-themecolor: text1" vAlign=top width=197&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;(objectClass=*)&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #eeeeee; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #eeeeee; WIDTH: 2.05in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; mso-border-bottom-themecolor: text1; mso-border-right-themecolor: text1" vAlign=top width=197&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;The search retrieves all objects.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 3"&gt;
&lt;TD style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #eeeeee; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 2.05in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1" vAlign=top width=197&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;PropertiesToLoad&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #eeeeee; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #eeeeee; WIDTH: 2.05in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; mso-border-bottom-themecolor: text1; mso-border-right-themecolor: text1" vAlign=top width=197&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;An empty string array&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #eeeeee; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #eeeeee; WIDTH: 2.05in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; mso-border-bottom-themecolor: text1; mso-border-right-themecolor: text1" vAlign=top width=197&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;The search retrieves all properties.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 4"&gt;
&lt;TD style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #eeeeee; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 2.05in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1" vAlign=top width=197&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;SearchScope&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #eeeeee; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #eeeeee; WIDTH: 2.05in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; mso-border-bottom-themecolor: text1; mso-border-right-themecolor: text1" vAlign=top width=197&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Subtree&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #eeeeee; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #eeeeee; WIDTH: 2.05in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; mso-border-bottom-themecolor: text1; mso-border-right-themecolor: text1" vAlign=top width=197&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;The search will be performed on the complete subtree of the base object (or entire domain in this case).&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 5; mso-yfti-lastrow: yes"&gt;
&lt;TD style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #eeeeee; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: black 1pt solid; WIDTH: 2.05in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1" vAlign=top width=197&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #eeeeee; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #eeeeee; WIDTH: 2.05in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; mso-border-bottom-themecolor: text1; mso-border-right-themecolor: text1" vAlign=top width=197&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #eeeeee; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #eeeeee; WIDTH: 2.05in; PADDING-TOP: 0in; BORDER-BOTTOM: black 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; mso-border-bottom-themecolor: text1; mso-border-right-themecolor: text1" vAlign=top width=197&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Constructors of the DirectorySearcher Class&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;The above table displays the default constructor when you create a DirectorySearcher instance like:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;DirectoryEntry rootEntry = new DirectoryEntry();&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// Binds root context&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;DirectorySearcher rootSearcher = new DirectorySearcher(rootEntry);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;The above specifies the &lt;B style="mso-bidi-font-weight: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;Search Root&lt;/I&gt;&lt;/B&gt;.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Specifying the Filter Only&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;We showed this earlier, &lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;DirectorySearcher rootSearcher = new DirectorySearcher(&amp;#8220;(sn=Hamilton)&amp;#8221;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Specifying the Search Root and Filter&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Create our base / root reference:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;DirectoryEntry rootEntry = new DirectoryEntry(&amp;#8220;LDAP://developer.hamilton.com/OU=Accounts,OU=Developers,DC=developer.DC=Hamilton,DC=com&amp;#8221;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;// Now specify the filter&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;DirectorySearch rootSearcher = new DirectorySearcher(rootEntry, &amp;#8220;(sn=Hamilton)&amp;#8221;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Specifying the Filter and a List of Properties to load&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;// Create the set of properties to load&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;string [] searchProperties = new string[4];&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;searchProperties[0] = &amp;#8220;name&amp;#8221;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;searchProperties[1] = &amp;#8220;sn&amp;#8221;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;searchProperties[2] = &amp;#8220;mail&amp;#8221;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;searchProperties[3] = &amp;#8220;telephoneNumber&amp;#8221;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;// Get all users that have an email ending in hamilton.com&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;DirectorySearcher rootSearcher = new DirectorySearcher(&amp;#8220;(mail=*hamilton.com)&amp;#8221;, searchProperties);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;The above example will return &lt;I style="mso-bidi-font-style: normal"&gt;all&lt;/I&gt; users from the rootDSE with an email ending in hamilton.com. Let&amp;#8217;s refine that.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Specifying the Root, Search Filter, and Properties to Load&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;// Specify the properties to load&amp;#8230; Here we get Full Name, Company, Phone&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;string [] searchProperties = new string[3];&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;searchProperties[0] = &amp;#8220;name&amp;#8221;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;searchProperties[1] = &amp;#8220;co&amp;#8221;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;searchProperties[2] = &amp;#8220;telephoneNumber&amp;#8221;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;// Now bind to a more refined root &amp;#8211; developers only&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;DirectoryEntry rootEntry = new DirectoryEntry(&amp;#8220;LDAP://developer.hamilton.com/OU=Accounts,OU=Developers,DC=developer,DC=hamilton,DC=com&amp;#8221;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;// No get all users from this root with an email ending in hamilton.com&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;DirectorySearcher rootSearcher = new DirectorySearcher(rootEntry, &amp;#8220;(mail=*hamilton.com)&amp;#8221;, searchProperties);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;You should have a better idea now how to use the various constructors of the DirectorySearcher class.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Methods of the DirectorySearcher&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;When you have created a binding and set filter values, you will use 1 of the 2 DirectorySearcher methods:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;FindOne()&lt;/B&gt; &amp;#8211; Returns the first, and only 1 object of the search criteria.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;FindAll()&lt;/B&gt; &amp;#8211; Returns a &lt;I style="mso-bidi-font-style: normal"&gt;SearchResultCollection&lt;/I&gt; of all objects that matched the search criteria.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;We&amp;#8217;ll do a brief sample for each method and wrap up this series with the Sorter class.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Return using FindOne()&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;// The following demonstrates that FindOne() returns only the first entry that matches the search critieria&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;DirectoryEntry rootEntry = new DirectoryEntry(&amp;#8220;LDAP://developer.hamilton.com/OU=Accounts,OU=Developers,DC=developer,DC=hamilton,DC=com&amp;#8221;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;DirectorySearcher rootSearcher = new DirectorySearcher(rootEntry);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;// What to search for&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;rootSearcher.Filter = &amp;#8220;(CN=*)&amp;#8221;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;// Specific properties to load&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;rootSearcher.PropertiesToLoad.Add(&amp;#8220;name&amp;#8221;);&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// Full name&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;rootSearcher.PropertiesToLoad.Add(&amp;#8220;mail&amp;#8221;);&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// Primary email addy&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;rootSearcher.PropertiesToLoad.Add(&amp;#8220;telephoneNumber&amp;#8221;);&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp; &lt;/SPAN&gt;// Phone #...&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;SearchResult searchResults = rootSearcher.FindOne();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;// Extract out the properties returned and display in a console&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;ResultPropertyCollection propertiesCollection;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;propertiesCollection = searchResults.Properties;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;// Cycle through and display (or add to a listbox, etc)&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;Foreach (string currentProperty in propertiesCollection.PropertyNames)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;foreach (Object thisCollection in propertiesCollection[currentProperty])&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Console.WriteLine(currentProperty + &amp;#8220; = &amp;#8220; + thisCollection);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Return using FindAll()&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Unlike above, the &lt;I style="mso-bidi-font-style: normal"&gt;ResultPropertyCollection&lt;/I&gt; being returned with FindOne(), &lt;B style="mso-bidi-font-weight: normal"&gt;FindAll()&lt;/B&gt; comes back in a &lt;I style="mso-bidi-font-style: normal"&gt;SearchResultCollection&lt;/I&gt; object.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;We would process the result set similar to the following:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;// Get all objects returned&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;foreach (SearchResult searchResults in rootSearcher.FindAll())&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;{&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// Process&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;foreach (string propertName in searchResults.Properties.PropertyNames)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;foreach (Object retEntry in searchResults.Properties[propertyName])&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;SPAN style="mso-tab-count: 3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Console.WriteLine(propertyName + &amp;#8220; = &amp;#8220; + retEntry);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Console.WriteLine(&amp;#8220;&amp;#8221;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;If the root of the search is not properly set, a &lt;I style="mso-bidi-font-style: normal"&gt;InvalidOperationException&lt;/I&gt; exception will be thrown. Also, if the provider you are trying this against is not supported, a &lt;I style="mso-bidi-font-style: normal"&gt;NotSupportedException&lt;/I&gt; exception is thrown.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Sorting the Result Sets&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Finally, the &lt;I style="mso-bidi-font-style: normal"&gt;SortOption&lt;/I&gt; class specifies how to sort the result set of a search. The class also allows you to specify either ascending or descending sort order.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Let&amp;#8217;s do a search on all users that have an email ending in @hamilton.com and that exist in the Developers OU. Further, restrict the properties returned, sort the list, and using the code snippet above, list the results in a console window.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;DirectoryEntry rootEntry = new DirectoryEntry(&amp;#8220;LDAP://developer.hamilton.com/OU=Accounts,OU=Developers,DC=developer,DC=hamilton,DC=com&amp;#8221;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;DirectorySearcher rootSearcher = new DirectorySearcher(rootEntry);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;// Set our search filter and properties to load&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;rootSearcher.Filter = &amp;#8220;(mail=*hamilton.com)&amp;#8221;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;rootSearcher.PropertiesToLoad.Add(&amp;#8220;name&amp;#8221;);&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// Full name&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;rootSearcher.PropertiesToLoad.Add(&amp;#8220;mail&amp;#8221;);&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// Primary email addy&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;rootSearcher.PropertiesToLoad.Add(&amp;#8220;telephoneNumber&amp;#8221;);&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp; &lt;/SPAN&gt;// Phone #...&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;// Now sort the result set&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;SortOption sortedResults = new SortOption();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;sortedResults.PropertyName = &amp;#8220;name&amp;#8221;;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// Sort by full name&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;sortedResults.Direction.SortDirection.Ascending;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;// Perform the search and output the results..&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;rootSearcher.Sort = sortedResults;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;foreach (SearchResult searchResults in rootSearcher.FindAll())&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;{&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// Process&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;foreach (string propertName in searchResults.Properties.PropertyNames)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;foreach (Object retEntry in searchResults.Properties[propertyName])&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;SPAN style="mso-tab-count: 3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Console.WriteLine(propertyName + &amp;#8220; = &amp;#8220; + retEntry);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Console.WriteLine(&amp;#8220;&amp;#8221;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Final notes on the following classes: &lt;I style="mso-bidi-font-style: normal"&gt;SearchResult, SearchResultCollection, ResultPropertyCollection,&lt;/I&gt; and&lt;I style="mso-bidi-font-style: normal"&gt; ResultPropertyValueCollection&lt;/I&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;The &lt;B style="mso-bidi-font-weight: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;SearchResult&lt;/I&gt;&lt;/B&gt; class consist of the first entry returned during a search. It retrieves the data from the &lt;I style="mso-bidi-font-style: normal"&gt;SearchResultCollection&lt;/I&gt;, and the &lt;B style="mso-bidi-font-weight: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;FindOne()&lt;/I&gt;&lt;/B&gt; method of the DirectorySearcher class returns an instance of the &lt;I style="mso-bidi-font-style: normal"&gt;SearchResult&lt;/I&gt; class.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;The &lt;B style="mso-bidi-font-weight: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;SearchResultCollection&lt;/I&gt;&lt;/B&gt; class is actually a collection of &lt;I style="mso-bidi-font-style: normal"&gt;SearchResult&lt;/I&gt; instances and these are returned using the &lt;B style="mso-bidi-font-weight: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;FindAll()&lt;/I&gt;&lt;/B&gt;&lt;I style="mso-bidi-font-style: normal"&gt; &lt;/I&gt;method of the DirectorySearcher class. You use the &lt;B style="mso-bidi-font-weight: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;Count&lt;/I&gt;&lt;/B&gt; property to get the number of items returned in the collection. Use the &lt;B style="mso-bidi-font-weight: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;Item&lt;/I&gt;&lt;/B&gt; property to index through the &lt;I style="mso-bidi-font-style: normal"&gt;SearchResultCollection&lt;/I&gt; to enumerate each property. Finally, the &lt;B style="mso-bidi-font-weight: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;PropertiesLoaded&lt;/I&gt;&lt;/B&gt; property returns a string array containing the names of the properties loaded for the original search criteria.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;The &lt;B style="mso-bidi-font-weight: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;ResultPropertyCollection&lt;/I&gt;&lt;/B&gt; class is accessed as a &lt;B style="mso-bidi-font-weight: normal"&gt;Properties&lt;/B&gt; property of the &lt;B style="mso-bidi-font-weight: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;SearchResult&lt;/I&gt;&lt;/B&gt; class. It has an &lt;B style="mso-bidi-font-weight: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;Item&lt;/I&gt;&lt;/B&gt; property you use to index the collection, which is a string value. This index retrieves the values of the property matching the specified index name as a &lt;B style="mso-bidi-font-weight: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;ResultPropertyValueCollection&lt;/I&gt;&lt;/B&gt;. The following snippet will demonstrate getting all returned properties and outputting the result to a console window:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;DirectoryEntry rootEntry = new DirectoryEntry(); // Entire domain&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;DireectorySearcher rootSearcher = new DirectorySearcher(rootEntry, &amp;#8220;(sn=Hamilton)&amp;#8221;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;SearchResult searchResults = rootSearcher.FindOne();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;// Get the properties returned&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;ResultPropertyCollection propertyCollection = &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;searchResults.Properties;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;// Output&amp;#8230;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;foreach (string thisProperty in propertyCollection.PropertyNames)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;foreach (Object propertyValue in propertyCollection[thisProperty])&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Console.WriteLine(thisProperty + &amp;#8220; = &amp;#8220; + propertyValue);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;In the future I will introduce ADSI API and application code and we will see about developing a small application that will take some of what we have reviewed in these three parts and create a directory browser sample application.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;I want to note that for the sample code so far, if you are not executing this on an actual AD domain controller, you will need to change the &lt;B style="mso-bidi-font-weight: normal"&gt;new DirectoryEntry()&lt;/B&gt; code to include the &lt;I style="mso-bidi-font-style: normal"&gt;root&lt;/I&gt;, &lt;I style="mso-bidi-font-style: normal"&gt;username&lt;/I&gt; and &lt;I style="mso-bidi-font-style: normal"&gt;password&lt;/I&gt; of the context you are trying to connect as (we have reviewed this in previous lessons).&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Finally, please forgive any typo&amp;#8217;s &amp;#8211; I try hard to make sure there are none.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;I have received a great deal of feedback over the little I have posted so far, and I hope this posting is helpful for some. I apologize again for taking so long to get this series posted.&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=85303"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=85303" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/mhamilton/aggbug/85303.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Michael J. Hamilton, Sr.</dc:creator>
            <guid>http://geekswithblogs.net/mhamilton/archive/2006/07/15/85303.aspx</guid>
            <pubDate>Sat, 15 Jul 2006 19:47:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/mhamilton/comments/85303.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/mhamilton/archive/2006/07/15/85303.aspx#feedback</comments>
            <slash:comments>21</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/mhamilton/comments/commentRss/85303.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/mhamilton/services/trackbacks/85303.aspx</trackback:ping>
        </item>
    </channel>
</rss>