Added escaping of invalid characters (e.g. brackets) to the userdn when querying for groups