This is the simplest solution that I can find.
using System.DirectoryServices.AccountManagement;
public bool UserIsAdmin(string userSamAccountName, string adminSamAccountName)
{
PrincipalContext context = new PricipalContext(ContextType.Domain);
GroupPrincipal adminGroup = new GroupPricipal(context, adminSamAccountName);
UserPrincipal user = UserPrincipal.FindByIdentity(context, userSamAccountName);
return user.IsMemberOf(adminGroup);
}
Edit: now be carefull, you don't want to leave the samAccount name of your domain admin group just lying about on the server if it is facing the internet.