Judgment of ouster or forfeiture.
Whenever any defendant shall be found guilty of any usurpation of or intrusion into, or unlawfully exercising any office or franchise within this state, or any office in any corporation created by the authority of this state, or when any public officer thus charged shall be found guilty of having done or suffered any act which by the provisions of the law shall work a forfeiture of his or her office, or when any association or number of persons shall be found guilty of having acted as a corporation without having been legally incorporated, the court shall give judgment of ouster against the defendant or defendants, and exclude him, her, or them from the office, franchise, or corporate rights, and in case of corporations that the same shall be dissolved, and the court shall adjudge costs in favor of the plaintiff.