I hope this helps:
Changing the locks on an resident's apartment without giving the resident a key would be a violation
of the Unlawful Eviction Law (NYC Administrative Code §26-521) if:
1) The resident is:
• A tenant or subtenant with a lease,
• An occupant who has lawfully lived in the apartment for more than thirty days (with or without
the lease),
• A subtenant, roommate or relative who has lived in the apartment for at least thirty days
(even if the person is not on the lease and has not made any direct payments to the
landlord),
• A resident of a rent stabilized hotel room who has made a request for a lease;
and
2) The landlord does not have a warrant of eviction.

