If the judgment be rendered upon the right of the person so alleged to be entitled, and the same be in favor of such person, he shall be entitled, after taking the oath of office and executing such official bond as may be required by law, to take upon himself the execution of the office; and it shall be his duty immediately thereafter, to demand of the defendant in the action all the books and papers in his custody or within his control belonging to the office from which he shall have been excluded.
SDCL 21-28-9