Under NY law, generally, a landlord is required to commence a nonpayment proceeding in the local court, obtain a judgment & a warrant of eviction & have a sheriff or marshal execute the warrant & deliver legal possession to the landlord (at which time the landlord will be permitted to change the locks).However, in 2010, there was an appeal decided by the Appellate Term (in the 1st Dept having jurisdiction over housing cases decided by Housing Court in NYC), where a commercial landlord was allowed to eject a commercial tenant & change the locks without commencing a court eviction proceeding (if the commercial lease had a clause stating that the landlord was authorized to engage in "self-help"), as long as the landlord first made a legally proper demand for rent in good faith. In addition, the tenant's ejection must be peaceable & there must have been rent actually due at the time the landlord takes such "self-help" action. Based upon your brief description of the facts, it cannot be determined whether the landlord engaged in self-help & changed the locks without going to court, or whether a nonpayment proceeding was commenced by the landlord. It is possible that you may not have been properly served with the court papers, or that you were served as required by statute & never received the papers, despite the landlord's compliance with the service requirements under the applicable law.If your eviction is found to be unlawful by a court, the court has the power to restore you to possession, or you may be entitled to seek a judgment for treble damages against the landlord, under the NY statute governing unlawful evictions. You should seriously consider consulting with an attorney who is experienced in this area of law, in order to evaluate your legal matter & advise you as to what your legal rights may be under the particular facts & circumstances of your case.