The court may issue a temporary restraining order, grant preliminary relief or take such other action necessary to enjoin or prevent the commission of drug-related criminal activity on or in the immediate vicinity of leased residential premises or otherwise to protect the rights and interests of all tenants and residents.
35 P.S. § 780-172