Under orders

Caused by law or rules to follow a certain course of action.

The soldier said that he was under orders to shoot the rifle.