If you want to return all users in an AD Group you can use this method :
SPPrincipalInfo principals = SPUtility.GetPrincipalsInGroup(SPContext.Current.Web, "TestGroup", 1000, out maxReached);
However, how can we reliably test to see if "TestGroup" exists ? If the group really doesn't exist then GetPrincipalsInGroup() returns null which is ok!
However, and here's the snag, that method ALSO returns null (no exception) if AD is down / unavailable, so gives a false result.
I don't want to have to hardcode a load of AD calls, as this could also be a forms-based group, or any other membership provider ...
Any ideas ???