Yes and no. The way I understand it, the lockers belong to the school, so may be searched. Contents, such as a backpack, belong to the student, so need a warrant.
+1 on the bolded part.
Lockers may be searched only if there is reasonable suspicion. That is, a dog who sniffs and stops at a locker is grounds to search it, or a student claims they saw another student placed a handgun in their locker (truth notwithstanding). Random searches, or even announced searches, have been found to be unconstitutional. Backpacks are private. I would think the police would have probable cause to search, not a teacher or school administrator, but I have no facts to back that up.