def user_member_of(conn,dn):
    """
    Get all groups user in member of. Takes arguments
    * connection object
    * Full DN of user
    Returns array of groups
    """
    groups = []
    conn.search(attributes=['Name'],
                search_base='dc=nnm,dc=local',
                search_filter='(&(Name=Map*)(member:1.2.840.113556.1.4.1941:='+dn+'))')
    for g in conn.entries:
        groups.append(str(g['name']))
    return groups