The High Court has ordered those occupying a vacant office building in Dublin City Centre to leave the premises by noon on 11 January.
The ten-storey office building on Tara Street has been empty since the middle of last year.
But last week a group of housing activists entered the premises and have been providing accommodation to those who need shelter.
Mr Justice Paul Gilligan said he was placing a stay on his order on condition that those occupying Apollo House undertake that no more than 40 people use the facilities, that the receivers would be entitled to access and supervise the property at all times, and that the defendants would co-operate fully with the receivers.
He also said he wanted the people who reconnected the electricity in the building to fully co-operate with anyone appointed by the receivers.
He said the defendants may have been well-intentioned but the court had to apply the law.
Mr Justice Gilligan said the defendants were trespassing and they had not shown that the circumstances were exceptional enough to persuade him that he should not grant the injunction.
His order will not come into effect until noon on 11 January if they co-operate with the receivers and allow them access to the building.
The matter will be back in court on 12 January to confirm that the order has been complied with.
The Home Sweet Home group, which has been driving the campaign, said they would take legal advice about any further legal options open to them.
They have invited Minister for Housing, Planning and Local Government Simon Coveney to visit the premises tomorrow morning.
In a statement, Tom O'Brien and Mazers said that they will "work with representatives of Home Sweet Home so that an orderly vacation of the building can be achieved by 11 January."