Every judicial officer shall have the power: (a) To preserve and enforce order in his or her immediate presence and in proceedings before him or her, when he or she is engaged in the performance of official duty; (b) To compel obedience to his or her lawful orders as provided in this Title; (c) To compel the attendance of persons to testify in a proceeding before him or her, in the case and manner provided in this Title; and (d) To administer oaths to persons in a proceeding pending before him or her and in all other cases where it may be necessary in the exercise of his or her powers and duties. 1985 SOURCE: CCP § 177; modified to make reference to new Title designations.