All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
Growing the beard is one of the confirmed religious commandments which a Muslim should abide by. According to the majority of the scholars shaving the beard is forbidden as clarified in Fatwa 84474. Moreover, it is known that it is not permissible to obey a creature in disobeying the Creator. The Prophet said: "There is no obedience in disobeying Allaah, obedience is required only in what is permissible." [Muslim].
Therefore, if the situation is as mentioned in the question that you cannot grow your beard in that school, then you may trim it since many scholars permitted trimming the beard. If still the school refuses that, then you may leave this school and go to another one which will not oblige you to shave your beard. Allaah Says (what means): {… And whosoever fears Allaah and keeps his duty to Him, He will make a way for him to get out (from every difficulty). And He will provide him from (sources) he never could imagine.}[Quran 65:2-3]. Allaah further Says (what means): {And whoever fears Allaah- He will make for him of his matter ease.}[Quran 65:4].
On the other hand, you may take advantage of some rules of democracy in that country which give you the freedom to grow your beard as a part your religious freedom; indeed many of those countries has set freedom as an idol to be worshiped besides Allaah. At last, if all the above means are of no avail and there is harm, then there it is permissible to do what would remove the harm.
For more benefit on the permissibility of shaving the beard when in necessity, please refer to Fataawa 84925 and 83699.
Allaah Knows best.