User.Principal.GetGroups() lookup wrong DC

André Hagemann 1 Reputation point


I work for a customer whose program makes a query on the groups of an AD. Until the time the DC was changed, the query with GetGroups() ran without problems. After the change GetGroups() points to a wrong DC address. Does anyone know where this old value comes from ? If I call GetGroups with context it works. I need this information for the external service provider that takes care of the AD.
Thanks a lot

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,403 questions
Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,056 questions
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,467 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 39,461 Reputation points

    Hi @André Hagemann

    If you use the nslookup xxxxx.xx where xxxxx.xx is your domain, do you recieve the IP address of the new DC or the old one? If you receive the old DC, you need to change your DNS setup.

    The UserPrincipal.GetGroups() should return the groups of the new DC.


    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments