Former top City Hall officials would be barred from lobbying any municipal agencies for two years under a bill passed by the City Council on Thursday, sending the measure to Mayor Adams.