Improved check on parent OU of existing group

Avoiding Regex and using more official way to grab parent. Regex might
not cover all possible cases and string manipulation is ugly.