title: I do not have access to the "employeeID" attribute of the "Active Directory" users through "C#"
body: <p>I do not have access to the "employeeID" attribute of the "Active Directory" users through "C#"</p>
  
  <p>I do not have access to the "employeeID" attribute of the "Active Directory" users through "C#", I verified that the users have a value in the attribute "employeeID" from the same "Active Directory", but the code "C#" does not access to this attribute, I have also validated with the software "Softerra LDAP Administrator 2019.1" and it does not show it either.</p>
  
  <p>The fact is that the client for whom I work has given me his VPN to access his network through Forticlient, and he has given me credentials to access his "Active Directory", I have succeeded in listing all the users and other general properties. , but I can not access the "employeeID" attribute.</p>
  
  <pre><code>class Program
      {
          static string ldapGeneral = "figssd.com.pe";
          static string ldapAD = "LDAP://112.128.123.18:3258/dc=figssd,dc=com,dc=pe";
          static string userAD = "saraoconner@figssd.com.pe";
          static string paswoordAD = "GDsds123";
  
          static void Main(string[] args)
          {
              LeerPropiedades();
              Console.WriteLine("Final");
              Console.ReadLine();
          }
  
          static void LeerPropiedades()
          {
              try
              {
                  DirectoryEntry searchRoot = createDirectoryEntry();
                  DirectorySearcher searcher = new DirectorySearcher(searchRoot, "(&amp;(objectClass=user)(objectCategory=person))");
                  searcher.PropertiesToLoad.Add("cn");
                  searcher.PropertiesToLoad.Add("employeeID");
                  searcher.SearchScope = SearchScope.Subtree;
                  searcher.PageSize = 1000; // Setting the PageSize value to 1000 will return all objects.
                  SearchResultCollection results = searcher.FindAll();
  
                  int i = 0;
  
                  foreach (SearchResult item in results)
                  {
                      if (item.Properties["employeeID"].Count &gt; 0)
                      {
                          Console.Write("/");
                          Console.WriteLine(Convert.ToString(item.Properties["employeeID"][0]));
                      }
                  }
              }
              catch (Exception ex)
              {
                  Console.WriteLine("Error");
              }
          }
          static DirectoryEntry createDirectoryEntry()
          {
              DirectoryEntry ldapConnection = new DirectoryEntry(ldapGeneral);
              ldapConnection.Path = ldapAD;
              ldapConnection.Username = userAD;
              ldapConnection.Password = paswoordAD;
              ldapConnection.AuthenticationType = AuthenticationTypes.Secure;
              return ldapConnection;
          }
  }
  </code></pre>
  
  <p>Please someone who knows if it's a permissions issue?</p>
  
  <p>Image of Active Directory Attribute :</p>
  
  <p><a href="https://i.stack.imgur.com/bgQms.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bgQms.png" alt="enter image description here"></a></p>