Based on the information you provided Absolutely NOT!
The commander’s authority does not exceed law. He/She can prevent alcohol in the barracks, but they cannot make a random policy for everyone not to consume alcohol. Does this order or policy also apply to the commander, the XO, senior enlisted, etc?
All this goes out the window if they are deployed, on training maneuvers, if the Soldier is enrolled in ASAP, then yes, the commander can order that Soldier not to consume alcohol. etc. Under such conditions consumption of alcohol can be prohibited.
If it is a normal duty day and the unit is not going through multiple days of training, then no, the commander cannot order everyone not to drink because a few members got DUI’s, public intoxicated, etc.