In Massachusetts, if you have lawful possession of a property, you may seek to prevent someone from trespassing on that property.
You may be able to file a no trespass order against the person that is trespassing on the property.
Under Massachusetts General LawsChapter 266, Section 120:
"Whoever, without right enters or remains in or upon the dwelling house, buildings, boats or improved or enclosed land, wharf, or pier of another, or enters or remains in a school bus, as defined in section 1 of chapter 90, after having been forbidden so to do by the person who has lawful control of said premises, whether directly or by notice posted thereon, or in violation of a court order pursuant to section thirty-four B of chapter two hundred and eight or section three or four of chapter two hundred and nine A, shall be punished by a fine of not more than one hundred dollars or by imprisonment for not more than thirty days or both such fine and imprisonment. Proof that a court has given notice of such a court order to the alleged offender shall be prima facie evidence that the notice requirement of this section has been met. A person who is found committing such trespass may be arrested by a sheriff, deputy sheriff, constable or police officer and kept in custody in a convenient place, not more than twenty-four hours, Sunday excepted, until a complaint can be made against him for the offence, and he be taken upon a warrant issued upon such complaint.This section shall not apply to tenants or occupants of residential premises who, having rightfully entered said premises at the commencement of the tenancy or occupancy, remain therein after such tenancy or occupancy has been or is alleged to have been terminated. The owner or landlord of said premises may recover possession thereof only through appropriate civil proceedings."
Essentially, once you provide notice to a person that they are no longer welcome on the property and provide a copy of that notice to the local police department, you may file a complaint against them with the police department, or you may file a complaint in the district court for trespass.
Under this statute, it appears that you may post a notice on the property, or provide notice to the person directly by sheriff or constable service.
This statute does not apply in a landlord/tenant situation, where you have not gone through the proper channels to evict a person.
If you are looking to file a no trespass order, contact my office to discuss whether this may be an option for you.