The court may order either party to pay to the clerk of the district court or to the State Disbursement Unit, as provided in section 42-369, a sum of money for the temporary support and maintenance of the other party and minor children if any are affected by the action and to enable such party to prosecute or defend the action. The court may make such order after service of process and claim for temporary allowances is made in the complaint or by motion by the plaintiff or by the defendant in a responsive pleading; but no such order shall be entered before three days after notice of hearing has been served on the other party or notice waived. During the pendency of any proceeding under sections 42-347 to 42-381 after the complaint is filed, upon application of either party and if the accompanying affidavit of the party or his or her agent shows to the court that the party is entitled thereto, the court may issue ex parte orders (1) restraining any person from transferring, encumbering, hypothecating, concealing, or in any way disposing of real or personal property except in the usual course of business or for the necessaries of life, and the party against whom such order is directed shall upon order of the court account for all unusual expenditures made after such order is served upon him or her, (2) enjoining any party from molesting or disturbing the peace of the other party or any minor children affected by the action, and (3) determining the temporary custody of any minor children of the marriage, except that no restraining order enjoining any party from molesting or disturbing the peace of any minor child shall issue unless, at the same time, the court determines that the party requesting such order shall have temporary custody of such minor child. Ex parte orders issued pursuant to subdivisions (1) and (3) of this section shall remain in force for no more than ten days or until a hearing is held thereon, whichever is earlier. After motion, notice to the party, and hearing, the court may order either party excluded from the premises occupied by the other upon a showing that physical or emotional harm would otherwise result. Any restraining order issued excluding either party from the premises occupied by the other shall specifically set forth the location of the premises and shall be served upon the adverse party by the sheriff in the manner prescribed for serving a summons, and a return thereof shall be filed in the court. Any person who knowingly violates such an order after service shall be guilty of a Class II misdemeanor. In the event a restraining order enjoining any party from molesting or disturbing the peace of any minor children is issued, upon application and affidavit setting out the reason therefor, the court shall schedule a hearing within seventy-two hours to determine whether the order regarding the minor children shall remain in force. Section 25-1064 shall not apply to the issuance of ex parte orders pursuant to this section. Any judge of the county court or district court may grant a temporary ex parte order in accordance with this section.