'I don't know if you can get this information by a web.config setting, but you can get this information from the System.DirectoryServices.AccountManagement namespace. (if you're looking per user)
You could store the domain name in the appsettings of the web.config and do something like...
private static PrincipalContext _ctx = new PrincipalContext(ContextType.Domain, System.Configuration.ConfigurationManager.AppSettings["DomainName"]);
public List<string> UserGroups(string userName)
{
List<string> ret = new List<string>();
using (UserPrincipal user = UserPrincipal.FindByIdentity(_ctx, userName))
{
if (user != null)
{
foreach (Principal p in user.GetAuthorizationGroups())
{
ret.Add(p.Name);
}
}
}
return ret;
}
The above will give you a list of groups a user belongs to, you could go deeper and get more info, but I think that's what you're trying to accomplish.