I have a problem with an MVC proyect I have.
The stack is the following:
System.Runtime.InteropServices.COMException (0x80005000): Unknown error (0x80005000) at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) at System.DirectoryServices.DirectoryEntry.Bind() at System.DirectoryServices.DirectoryEntry.get_Name() at PosmanWeb2.Controllers.Helpers.SessionHelpers.GetGroup(SearchResult result) at PosmanWeb2.Controllers.Helpers.SessionHelpers.GetPerfilAD(SearchResult result) at PosmanWeb2.Controllers.Helpers.SessionHelpers.GetUser() at PosmanWeb2.Controllers.Helpers.SessionHelpers.ConnectActiveDirectory()
The Methods on SessionHelpers are part of the proyect, the last one seems to be having problems, the code is the following:
private static List<string> GetGroup(SearchResult result)
{
List<string> nombresPerfilAD = new List<string>();
foreach (var i in result.Properties["memberOf"])
{
var group = new DirectoryEntry(@"LDAP://" + i);
nombresPerfilAD.Add(group.Name.Split('=')[1].ToUpper().Trim());
}
return nombresPerfilAD;
}
What it basically does is save all the Active Directory profiles on a list.
One user in particular did not have this problem what another two have this exact problem.
I saw on other threads that it could be related to permission problems, but Im not 100% sure where to look.
PrincipalContextyou can get at the groups in AD without having to do it the old LDAP way - MethodMan