def check_share_access(shares, con):
    """
    Checks if a list of shares are accessible

    Args:
        shares: (list) A list of share objects
        con: (SMBConnection) The SMB connection objects

    Returns:
        A list of shares that were accessible
    """

    accessible = []

    for share in shares:
        try:
            tree_id = con.connectTree(share)
            print(f"[+] Share is accessible: {share}")
            accessible.append({'name': share, 'id': tree_id})
        except Exception as e:
            print(f"[-] Share is not accessible: {share}, {str(e)}")
            continue

    return accessible