(1) A tenant who has obtained a court order from a court of competent jurisdiction granting him or her possession of a dwelling unit to the exclusion of one or more cotenants may request that a lock be replaced or configured for a new key at the tenant's expense. The landlord shall, if provided a copy of the order, comply with the request and shall not provide copies of the new keys to the tenant restrained or excluded by the court's order. This section does not release a cotenant, other than a household member who is the victim of domestic violence, sexual assault, or stalking, from liability or obligations under the rental agreement.
(2) A landlord who replaces a lock or configures for a new key of a residential housing unit in accordance with subsection (1) of this section shall be held harmless from liability for any damages that result directly from the lock change.