UserPrincipal.GetGroups issue

  • Thread starter Thread starter VJBU C
  • Start date Start date
V

VJBU C

Guest
Hi,

I am trying to get the usergroups using below code.

var domainContext = new PrincipalContext(ContextType.Domain, domain);
var user = UserPrincipal.FindByIdentity(domainContext, username);

var groups = user.GetGroups()

But I am getting the error.

[ActiveDirectoryServerDownException: The server is not operational.

Name: "DomainController.Domain.com"

]

System.DirectoryServices.ActiveDirectory.PropertyManager.GetPropertyValue(DirectoryContext context, DirectoryEntry directoryEntry, String propertyName) +510

System.DirectoryServices.ActiveDirectory.DirectoryEntryManager.ExpandWellKnownDN(WellKnownDN dn) +239

System.DirectoryServices.ActiveDirectory.DomainController.get_Domain() +71

System.DirectoryServices.AccountManagement.ADStoreCtx.GetGroupsMemberOf(Principal p) +839

System.DirectoryServices.AccountManagement.Principal.GetGroups() +32


The issue is, the active directory server mentioned in the error is demoted. But we are not sure from where it is getting the name. There are other DCs available still it is pointing to the demoted DC. Can you please help me to find out from where it is getting the name of the demoted DC and why it is not pointing to other DCs when this one is not available?


Thanks in advance.


Regards,

Vijay.C

Continue reading...
 

Similar threads

Back
Top