All courts in this state and each judge, justice, magistrate, referee, clerk, and deputy clerk thereof; members and referees of the division of labor standards and statistics; members of the public utilities commission; and notaries public have power to administer oaths and affirmations to witnesses and others concerning any matter, thing, process, or proceeding pending, commenced, or to be commenced before them respectively. The courts, judges, magistrates, referees, clerks, and deputy clerks within their respective districts or counties; a person designated by the governing body, or any officer thereof; and notaries public within any county of this state have the power to administer all oaths or affirmations of office and other oaths or affirmations required to be taken by any person upon any lawful occasion and to take affidavits and depositions concerning any matter or thing, process, or proceeding pending, commenced, or to be commenced in any court or on any occasion an affidavit or a deposition is authorized or by law required to be taken.