Because the parent poster's comment is dead, I'm responding to yours. Yes, obeying unlawful orders from your commanding officer is a violation of the UCMJ, and you will be criminally charged for doing so unless it can be demonstrated through strong evidence that you could not have known the order was unlawful. You are simply responsible for your own actions, as is everyone else (including the police).