Ex parte relief commonly used in situations involving domestic violence or where there is some sort of danger to the children.
In situations involving an abusive spouse the court will issue a restraining order, which would normally order the abusive spouse to move out of the house, to stay at least 100 yards away from the other party's home, job, car and person. It would also prevent the sending of any messages to the protected party, even through a third person, or by way of a gift. The consequences of violating an order are severe, and can include up to one year in jail.
At that point, the alleged abusive party has the ability to tell his or her side of the story. If you are accused of perpertrating domestic violence, beware: anything you say in open court can later be used to prosecute you. If the domestic violence occurred in front of children, the abusive spouse can lose custody of the children.
The other situation would typically be where the parties have children and a true emergency exists. This is called having exigent circumstances and the potential of irreparable harm. Simply put, in order to make a temporary order for child custody the court must find the child is in some sort of immediate and probable danger which is so serious that it cannot be corrected: either one parent is about to flee the state with the child, or the child is in some sort of physical danger.
Tempoary orders that are only good for about three weeks. Some time before the orders expire, the parent requesting the order must return for a hearing where parties have a change to address the court and appear with an attorney. If the court finds good cause, the TRO will be extended. If not, it will be dissolved.