title: C# Create OU in Active Directory
body: <p>I'm struggling to create an OU for Active Directory using the code below.</p>
  
  <pre><code>strPath = "OU=TestOU,DC=Internal,DC=Com"
  
  DirectoryEntry objOU; 
  objOU = ADentry.Children.Add(strPath, "OrganizationalUnit");
  objOU.CommitChanges();
  </code></pre>
  
  <p>The problem is strPath contains the full path 'OU=TestOU,DC=Internal,DC=net' so using .Children.Add is making the ldap path 'OU=TestOU,DC=Internal,DC=net,DC=Internal,DC=net' which results in an error as the domain obviously doesn't exist. </p>
  
  <p>My question is can I create an OU using <code>strPath</code> without <code>.Children.Add</code>? </p>
  
  <p>I'm not familiar with AD and this is something I inherited from the guy before me.</p>