none
Could not retrieve “UserCertificate” Property From Active Directory User account RRS feed

  • Question

  • I have been trying to retrieve a property named "userCertificate" from an user's Directory entry through C#. However I could not find it. After read few articles I have done

     dirEntry.RefreshCache(new string[]{"userCertificate"})

    To view the property, still the attribute is unavailable to me.

    When I check with ADExplorer it shows the userCertificate Property for the same user.

    Can anyone let me know how to fetch the property.

    Thursday, August 7, 2014 1:56 PM

Answers

  • Hello,

    >>Can anyone let me know how to fetch the property.

    Try with below code:

    static void Main(string[] args)
    
            {
    
    
                DirectoryEntry entry = new DirectoryEntry(DomainName);
    
                DirectorySearcher dSearch = new DirectorySearcher(entry);
    
                dSearch.Filter = "(&(objectClass=user)(cn=" + UserName + "))";
    
                SearchResult sResultSets = dSearch.FindOne();
    
                foreach (var result in sResultSets.Properties.PropertyNames)
    
                {
    
                    Console.WriteLine("Property Name: "+result.ToString());
    
                }
    
    
            }
    

    It could list all properties based on a user:

    If I misunderstand, please let me know.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, August 8, 2014 6:56 AM
    Moderator