title: How I can find a User with the GUID(objectGUID) Parameter in Active Directory
body: <p>In my ASP.NET Application I get Informations from Active Directory. I must get Informations about a User with the GUID Informations (example: a28a6a34dsfdsf57d9e54f945a241) but I don't know how I can use the filter right for this search :/</p>
  
  <p>for example if I search to a User Lastname:</p>
  
  <pre><code>DirectoryEntry Entry = new DirectoryEntry("LDAP://" + "Domain");
  
              string filter = "(&amp;(objectClass=user)(objectCategory=person)(cn=" + txtBenutzer.Text + "*))";
  
              DirectorySearcher Searcher = new DirectorySearcher(Entry, filter);
  
              var q = from s in Searcher.FindAll().OfType&lt;SearchResult&gt;()
                      select new
                      {
                          //GetProperty(s, "objectGUID"),
                          Benutzer = GetProperty(s, "sAMAccountName"),
                          eMail = GetProperty(s, "mail"),
                          Vorname = GetProperty(s, "givenName"),
                          Nachname = GetProperty(s, "sn"),
                          Telefon = GetProperty(s, "telephoneNumber"),
                          UserID = s.GetDirectoryEntry().NativeGuid
  
                      };
  
              this.myListView.DataSource = q;
              this.myListView.DataBind();
  </code></pre>
  
  <p>now I need a filter with the GUID that I can find the one and only user in AD. The GUID for this Search I have in a  string UserID = Session["UserID"].toString() </p>
  
  <p>tarasov</p>