The Previous Lubavitcher Rebbe, in his memoirs, recounts a story about the Alter Rebbe's (Rabbi Schneur Zalman, the first Chabad Rebbe) great-grandfather, R' Baruch Batlan. Apparently, he was a tenant in a building which became inhabited by sheidim after the passing of the building's owners. After trying several ways to remove them, his Rebbe, R' Yoel, the Baal Shem of Zamoshtch, came and called them to a "Din Torah". The story is fascinating in its entirety, but in short, the Beis Din paskened that they must leave the building, so they did.
Interestingly, it appears that they are held by the ban to avoid inhabited places, and only violated it in this case on the orders of Ashmedai. TheyThe sheidim held that they were the legal heirs to the building's owners, because theythe owners' curses had been created by their cursesthem.
This story took place in the mid-1600's