Hi, I am trying to add a user or group from the LDAP domain but i could not add throwing "The specified directory service attribute or value does not exist."

V.Sathishkumar 0 Reputation points
2024-09-12T10:12:34.0266667+00:00

Hi ,
I am trying to add user and using Principle context "principalContext = new PrincipalContext(ContextType.Domain, domain);"to create a context it is throwing an error "The specified directory service attribute or value does not exist.".It is happening only for one root domain child domain are working as expected but it got broken recently before one week. Here only i am returning " return UserPrincipal.FindByIdentity(principalContext, userOrGroupName.Trim());".Any help on this

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,534 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Daisy Zhou 23,426 Reputation points Microsoft Vendor
    2024-09-13T07:44:17.3266667+00:00

    Hello V.Sathishkumar,

    Thank you for posting in Q&A forum.

    1. Check for Recent Changes: Since this issue started recently, check if there have been any changes in the domain configuration, such as updates, policy changes, or permission modifications.
    2. Use Logging: Implement logging to capture more detailed error information. This can help identify the exact cause of the issue.
    3. Test with Different Context Types: Try using different context types or specifying different containers to see if the issue persists.

    PrincipalContext principalContext = new PrincipalContext(ContextType.Domain, "yourDomain", "OU=Users,DC=yourDomain,DC=com");

    I hope the information above is helpful.

    If you have any questions or concerns, please feel free to let us know.

    Best Regards,

    Daisy Zhou

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

  2. Daisy Zhou 23,426 Reputation points Microsoft Vendor
    2024-09-13T08:18:10.8466667+00:00

    Hello V.Sathishkumar,

    Thank you for posting in Q&A forum.

    1. Check for Recent Changes: Since this issue started recently, check if there have been any changes in the domain configuration, such as updates, policy changes, or permission modifications.
    2. Use Logging: Implement logging to capture more detailed error information. This can help identify the exact cause of the issue.
    3. Test with Different Context Types: Try using different context types or specifying different containers to see if the issue persists.

    PrincipalContext principalContext = new PrincipalContext(ContextType.Domain, "yourDomain", "OU=Users,DC=yourDomain,DC=com");

    I hope the information above is helpful.

    If you have any questions or concerns, please feel free to let us know.

    Best Regards,

    Daisy Zhou

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.