Authorities have obtained a protective order against a man after he was spotted with an apparent weapon near an East County middle school.