title: LDAP Directory Entry in .Net - not working with OU=Users
body: <p>I have the following code (C#):</p>
  <p>(Tweaked from: <a href="http://www.eggheadcafe.com/conversation.aspx?messageid=31766061&amp;threadid=31766050" rel="noreferrer">http://www.eggheadcafe.com/conversation.aspx?messageid=31766061&amp;threadid=31766050</a>)</p>
  <pre><code>DirectorySearcher dseSearcher = new DirectorySearcher();
  
  string rootDSE = dseSearcher.SearchRoot.Path;
  DirectoryEntry rootDE = new DirectoryEntry(rootDSE);
  
  string userDSE = rootDSE.Insert(7, &quot;OU=Users,&quot;);
  DirectoryEntry userDE = new DirectoryEntry(userDSE);
  </code></pre>
  <p>The <code>rootDSE</code> is created correctly, however, the user <code>userDSE</code> is unusable and throws &quot;There is no such object on the server&quot; exception if I attempt to use it.</p>
  <p>The LDAP strings are as follows:</p>
  <blockquote>
  <p>Root: LDAP://DC=company,DC=local</p>
  <p>User: LDAP://OU=Users,DC=company,DC=local</p>
  </blockquote>
  <p>I'm running on Vista as Admin, but need this to work on XP (Admin) as well.</p>
  <p>I'm new to LDAP and Directory Management, so I'm stumbling around in the dark here. Any thoughts? Also - any articles to link too that could give me some insight into how it all works would be appreciated.</p>