title: Getting all users from Active Directory PrincipalContext
body: <p>I am using the following code to access the list of users in my AD, however on the line where I add the users to my combobox I get a null reference exception.</p>
  
  <pre><code>PrincipalContext AD = new PrincipalContext(ContextType.Domain, "mydomainip");
  UserPrincipal u = new UserPrincipal(AD);
  PrincipalSearcher search = new PrincipalSearcher(u);
  
  foreach (UserPrincipal result in search.FindAll())
  {
      if (result.DisplayName != null)
      {
          comboBox2.Items.Add(result.DisplayName);
      }
  }
  </code></pre>
  
  <p>Any idea what I'm doing wrong?</p>
  
  <p>I replaced the combobox with a <code>Console.WriteLine(result.DisplayName)</code> and it works fine.</p>