For example: It is illegal to lockout a Tenant from a property in which they claim they are residing in without given notice. The Police officer knew for a fact that this tenant was illegally residing in an apartment because he knew who the true tenant of the apartment was. The Officer than proceeded to command the Landlord to illegally lock-out the "fake" tenant causing the Landlord to be subjected in an unlawful act. Now, would the Landlord be held liable for simply doing what a police officer told him to do?
The closest precedent that I can find is US v. William Calley 22 U.S.C.M.A. 534. There are significant non-parallelisms: Calley's trial was military, and the offense was murder. The parallelism is that Calley was (supposedly: this allegation was never proven) given an order to do something illegal. The court cites the instructions given by the court-martial judge which stated:
The acts of a subordinate done in compliance with an unlawful order given him by his superior are excused and impose no criminal liability upon him unless the superior's order is one which a man of ordinary sense and understanding would, under the circumstances, know to be unlawful, or if the order in question is actually known to the accused to be unlawful
There is ample evidence that this is a general rule under military law. A fact that makes military law quite different from ordinary law is that soldiers have a vastly higher duty to obey orders. Despite that duty, saying "I was just following orders" does not relieve a soldier of his duty to obey the law. So it is even less likely that a civilian court would accept a "just following orders" defense. In Neu v. McCarthy 309 Mass. 17, another military orders case, the court acknowledges that
obedience to a military order [is] a justification for conduct which would otherwise give rise to civil or criminal liability, unless the order is so palpably unlawful that a reasonable man in the position of the person obeying it would perceive its unlawful quality
and in this instance they say
An order to keep the convoy together even if that involved continuing in the face of a red light, although illegal, cannot, we think, under circumstances not here in dispute, be deemed palpably and obviously illegal to a private soldier in the position of the plaintiff
Applying the "knew or should have known" filter in this case, landlords should probably know that there are laws about eviction (though it legally suffices that they manage to not violate the law), but I would say that this is not a case where a man of a man of ordinary sense and understanding would know that the order was unlawful. It's hard to guess how a court would actually rule.