[stackoverflow] [progress Openedge Abl] Ad Group Check Throws Error (only If Connected To...

Status
Not open for further replies.
H

HugoHiasl

Guest
I have actually a really strange problem to solve.

I created a web application using .net 4.0. It is installed on a 2008R2 web server.

If I use the connection to my development MSSQL database it works just fine. If I use the connection to my production database on another server I get an error.

Interestng part is that the error is completely SQL unrelated. I am doing AD Group check at the position in code where the exception is thrown.

It happens here:

userGroups = GetGroups(user.Identity.Name);


The function is this:

private List<GroupPrincipal> GetGroups(string userName)
{
List<GroupPrincipal> result = new List<GroupPrincipal>();

// establish domain context
PrincipalContext yourDomain = new PrincipalContext(ContextType.Domain, "ourdomaincom");

// find your user
UserPrincipal user = UserPrincipal.FindByIdentity(yourDomain, userName);

// if found - grab its groups
if (user != null)
{
PrincipalSearchResult<Principal> groups = user.GetAuthorizationGroups();

// iterate over all groups
foreach (Principal p in groups)
{
// make sure to add only group principals
if (p is GroupPrincipal)
{
result.Add((GroupPrincipal)p);
}
}
}

return result;
}


The error looks like:

I know that actually there are some Domain Server upgrades done. But why does this happen with one database connection and not with the other? Both databases use the same SQL Server version.

Continue reading...
 
Status
Not open for further replies.
Top