<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Listing all domains in a forest</title>
	<atom:link href="http://www.indented.co.uk/index.php/2008/10/21/listing-all-domains-in-a-forest/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.indented.co.uk/index.php/2008/10/21/listing-all-domains-in-a-forest/</link>
	<description></description>
	<lastBuildDate>Tue, 10 Aug 2010 14:29:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Chris</title>
		<link>http://www.indented.co.uk/index.php/2008/10/21/listing-all-domains-in-a-forest/comment-page-1/#comment-342</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Fri, 02 Jul 2010 10:46:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.highorbit.co.uk/?p=310#comment-342</guid>
		<description>Thanks! Fixed the example.

Chris</description>
		<content:encoded><![CDATA[<p>Thanks! Fixed the example.</p>
<p>Chris</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian Walker</title>
		<link>http://www.indented.co.uk/index.php/2008/10/21/listing-all-domains-in-a-forest/comment-page-1/#comment-341</link>
		<dc:creator>Ian Walker</dc:creator>
		<pubDate>Fri, 02 Jul 2010 10:43:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.highorbit.co.uk/?p=310#comment-341</guid>
		<description>In the VBScript code, the query on line 12 will fail with a &quot;Table does not exist&quot; error unless &quot;LDAP&quot; is in upper case.

Otherwise, thanks for this, saved me an hour writing it from scratch.</description>
		<content:encoded><![CDATA[<p>In the VBScript code, the query on line 12 will fail with a &#8220;Table does not exist&#8221; error unless &#8220;LDAP&#8221; is in upper case.</p>
<p>Otherwise, thanks for this, saved me an hour writing it from scratch.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Wernle</title>
		<link>http://www.indented.co.uk/index.php/2008/10/21/listing-all-domains-in-a-forest/comment-page-1/#comment-15</link>
		<dc:creator>Daniel Wernle</dc:creator>
		<pubDate>Mon, 24 Nov 2008 13:46:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.highorbit.co.uk/?p=310#comment-15</guid>
		<description>A slightly different way to do it is over a search of the trusted Domains. needed it some time ago to search on different domains in a forrest and fill up objects with the &quot;Domain\\Username&quot; notation ...
[code lang=&quot;csharp&quot;]
///
/// Gets All Trusted Domains in the Domain Forrest
///
public Dictionary GetDomains()
{
    SearchResultCollection srCollection;
    DirectoryEntry deRoot = new DirectoryEntry(@&quot;LDAP://eu.infineon.com:389/DC=infineon,DC=com&quot;);
            DirectorySearcher deSearcher = new DirectorySearcher(deRoot);
            deSearcher.Filter = (&quot;(objectClass=trustedDomain)&quot;);
            deSearcher.PageSize = 1000;
            deSearcher.SearchScope = SearchScope.Subtree;
            srCollection = deSearcher.FindAll();

            //ArrayList DomainList = new ArrayList();
            Dictionary DomainList = new Dictionary();

            foreach (SearchResult se in srCollection)
            {
                string currentDomainName = se.GetDirectoryEntry().Name.ToString();
                string currentNomainFlatName = se.GetDirectoryEntry().Properties[&quot;flatname&quot;].Value.ToString();
                currentDomainName = currentDomainName.Replace(&quot;.&quot;, &quot;,DC=&quot;);
                currentDomainName = currentDomainName.Replace(&quot;CN&quot;, &quot;DC&quot;);
                DomainList.Add(currentDomainName,currentNomainFlatName);
            }

            return DomainList;
        }
[/code]
nice article, thx</description>
		<content:encoded><![CDATA[<p>A slightly different way to do it is over a search of the trusted Domains. needed it some time ago to search on different domains in a forrest and fill up objects with the &#8220;Domain\\Username&#8221; notation &#8230;</p>
<pre class="brush: csharp;">
///
/// Gets All Trusted Domains in the Domain Forrest
///
public Dictionary GetDomains()
{
    SearchResultCollection srCollection;
    DirectoryEntry deRoot = new DirectoryEntry(@&quot;LDAP://eu.infineon.com:389/DC=infineon,DC=com&quot;);
            DirectorySearcher deSearcher = new DirectorySearcher(deRoot);
            deSearcher.Filter = (&quot;(objectClass=trustedDomain)&quot;);
            deSearcher.PageSize = 1000;
            deSearcher.SearchScope = SearchScope.Subtree;
            srCollection = deSearcher.FindAll();

            //ArrayList DomainList = new ArrayList();
            Dictionary DomainList = new Dictionary();

            foreach (SearchResult se in srCollection)
            {
                string currentDomainName = se.GetDirectoryEntry().Name.ToString();
                string currentNomainFlatName = se.GetDirectoryEntry().Properties[&quot;flatname&quot;].Value.ToString();
                currentDomainName = currentDomainName.Replace(&quot;.&quot;, &quot;,DC=&quot;);
                currentDomainName = currentDomainName.Replace(&quot;CN&quot;, &quot;DC&quot;);
                DomainList.Add(currentDomainName,currentNomainFlatName);
            }

            return DomainList;
        }
</pre>
<p>nice article, thx</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oleg</title>
		<link>http://www.indented.co.uk/index.php/2008/10/21/listing-all-domains-in-a-forest/comment-page-1/#comment-16</link>
		<dc:creator>Oleg</dc:creator>
		<pubDate>Sun, 09 Nov 2008 08:24:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.highorbit.co.uk/?p=310#comment-16</guid>
		<description>Hi, thank you for the scripts.
I tried PS and c# codes. They retrieve only one domain in my environment.
But I have 6 domains, if I open my Network Places-&gt;Microsoft Windows Networks I see them.
Also, I can retrieve 6 items when I use this code
[code lang=&quot;csharp&quot;]
DirectoryEntry rootEntry = new DirectoryEntry(&quot;WinNT:&quot;);
foreach (DirectoryEntry child in rootEntry.Children)
{
   listBox1.Items.Add(child.Name);
}
[/code]
But I&#039;d like ot use LDAP because of WinNT is legacy provider.
Thanks.</description>
		<content:encoded><![CDATA[<p>Hi, thank you for the scripts.<br />
I tried PS and c# codes. They retrieve only one domain in my environment.<br />
But I have 6 domains, if I open my Network Places-&gt;Microsoft Windows Networks I see them.<br />
Also, I can retrieve 6 items when I use this code</p>
<pre class="brush: csharp;">
DirectoryEntry rootEntry = new DirectoryEntry(&quot;WinNT:&quot;);
foreach (DirectoryEntry child in rootEntry.Children)
{
   listBox1.Items.Add(child.Name);
}
</pre>
<p>But I&#8217;d like ot use LDAP because of WinNT is legacy provider.<br />
Thanks.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
