Legal question/NYS/Real Estate foreclosure and issue of security deposits

Live in New York and unfortunatly im having an apartment building that i own get foreclosed in a few months. Question i have is about security deposits. I know they are seperate accounts and all and kept in escrow but i dont ever remember any forclosures in my area where the bank gets a big wad of security deposit $ after they foreclose on a persons property. So how does that work? Is the bank after issuing a foreclosure repay the security deposits many months later when the tenants move out as sort of a closing cost expence? Or does the bank just say the tenants have to take the old landlord to court?

I’m not sure I understand why this is an issue. I assume that you just transfer custodianship of the escrowed funds to the bank or whatever management company they set up to administer the apartment building. The money belongs to the tenants and isn’t part of the assets being foreclosed.

I am a New York Real Estate Lawyer, and my comment on this is that this is one of the instances where you CANNOT rely on advice from a message board and must consult your own lawyer.

I know that there are laws on this, though I don’t recall what they are. I do know, however, that proper treatment of tenant security deposits is an area that New York law takes quite seriously. See a lawyer.