Try prefixing the group name with the domain, i.e. If InGroup("mydomain\mygroup")...