The owners of 42 rent-regulated buildings in New York City have agreed to extend more than $1 million in rent credits to nearly 1,700 tenants under a settlement with Attorney General Eric Schneiderman announced Tuesday.

The owners, a partnership of several private equity firms including Normandy Real Estate Partners and Westbrook Partners, also agreed to terminate Colonial Management, the managing company for the buildings, which are located in Manhattan, the Bronx and Brooklyn. Schneiderman’s office is investigating alleged harassment of tenants by Colonial.

Schneiderman’s office began investigating Colonial and the building owners after tenants complained they were being harassed last year for trying to organize. The tenants organized in response to reports that the buildings were facing foreclosure. They complained that the management company broke up peaceful tenant meetings and charged them illegal fees.

The attorney general’s office found that in addition to harassing tenants, the owners and management company failed to maintain the buildings.

Under the settlement, the owners will give all tenants in the buildings a $600 rent credit and will perform all repairs needed to bring the buildings up to the city’s housing code. They have agreed not to increase tenants’ rent for any of those required improvements.

They have also agreed to give the tenants notices of their right to organize and to report periodically to the attorney general’s office.