Yeah, that will get you in trouble. Actually, in most places having any meds on you at school can get you in trouble, even if it's just an aspirin.
Have Xanax on you at school without a prescription can both get you suspended AND in trouble with the law, should the school choose to report it.