Question

I'm having issues with .NET's UserPrincipal.GetGroups() method.

On nearly all system in my domain I can call

var groups = UserPrincipal.Current.GetGroups().ToArray()

and it returns the groups the current user is in. But there is one Windows 2008 R2 Enterprise Server which crashes when executing this with the message:

The server is not operational. Name: TESTDOMAIN.ORG

I think that this server has a different configuration somehow but it's part of the same domain.

Console.WriteLine(
  new DirectoryEntry("LDAP://RootDSE")
  .Properties["defaultNamingContext"]
  .Value
  .ToString()
);

Shows the same on all systems: DC=GLOBAL,DC=TESTDOMAIN,DC=ORG

Where could I look ? What could be the problem ? How to solve it ?

Was it helpful?

Solution

I finally found it. The problem is, that the server did not know what standard gateway to use. Solution is to go to network options, select the LAN interface which is used, edit the IPv4 entry and set a standard gateway. This way the network will no longer be shown as "unidentified network" under network neighbourhood and all LDAP related queries will work again.

This one struggled me for days, so I hope this answer could help you too.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top