(a)(1) A United States district court, upon application of the attorney for the Government, shall issue a temporary restraining order prohibiting harassment of a victim or witness in a Federal criminal case if the court finds, from specific facts shown by affidavit or by verified complaint, that there are reasonable grounds to believe that harassment of an identified victim or witness in a Federal criminal case exists or that such order is necessary to prevent and restrain an offense under section 1512 of this title, other than an offense consisting of misleading conduct, or under section 1513 of this title.
(2)(A) A temporary restraining order may be issued under this section without written or oral notice to the adverse party or such party's attorney in a civil action under this section if the court finds, upon written certification of facts by the attorney for the Government, that such notice should not be required and that there is a reasonable probability that the Government will prevail on the merits.
(B) A temporary restraining order issued without notice under this section shall be endorsed with the date and hour of issuance and be filed forthwith in the office of the clerk of the court issuing the order.
(C) A temporary restraining order issued under this section shall expire at such time, not to exceed 14 days from issuance, as the court directs; the court, for good cause shown before expiration of such order, may extend the expiration date of the order for up to 14 days or for such longer period agreed to by the adverse party.
(D) When a temporary restraining order is issued without notice, the motion for a protective order shall be set down for hearing at the earliest possible time and takes precedence over all matters except older matters of the same character, and when such motion comes on for hearing, if the attorney for the Government does not proceed with the application for a protective order, the court shall dissolve the temporary restraining order.
(E) If on two days notice to the attorney for the Government, excluding intermediate weekends and holidays, or on such shorter notice as the court may prescribe, the adverse party appears and moves to dissolve or modify the temporary restraining order, the court shall proceed to hear and determine such motion as expeditiously as the ends of justice require.
(F) A temporary restraining order shall set forth the reasons for the issuance of such order, be specific in terms, and describe in reasonable detail (and not by reference to the complaint or other document) the act or acts being restrained.
(b)(1) A United States district court, upon motion of the attorney for the Government, or its own motion, shall issue a protective order prohibiting harassment of a victim or witness in a Federal criminal case or investigation if the court, after a hearing, finds by a preponderance of the evidence that harassment of an identified victim or witness in a Federal criminal case or investigation exists or that such order is necessary to prevent and restrain an offense under section 1512 of this title, other than an offense consisting of misleading conduct, or under section 1513 of this title.
(2) In the case of a minor witness or victim, the court shall issue a protective order prohibiting harassment or intimidation of the minor victim or witness if the court finds evidence that the conduct at issue is reasonably likely to adversely affect the willingness of the minor witness or victim to testify or otherwise participate in the Federal criminal case or investigation. Any hearing regarding a protective order under this paragraph shall be conducted in accordance with paragraphs (1) and (3), except that the court may issue an ex parte emergency protective order in advance of a hearing if exigent circumstances are present. If such an ex parte order is applied for or issued, the court shall hold a hearing not later than 14 days after the date such order was applied for or is issued.
(3) At the hearing referred to in paragraph (1) of this subsection, any adverse party named in the complaint shall have the right to present evidence and cross-examine witnesses.
(4) A protective order shall set forth the reasons for the issuance of such order, be specific in terms, describe in reasonable detail the act or acts being restrained.
(5) The court shall set the duration of effect of the protective order for such period as the court determines necessary to prevent harassment of the victim or witness but in no case for a period in excess of three years from the date of such order's issuance. The attorney for the Government may, at any time within ninety days before the expiration of such order, apply for a new protective order under this section, except that in the case of a minor victim or witness, the court may order that such protective order expires on the later of 3 years after the date of issuance or the date of the eighteenth birthday of that minor victim or witness.
(c) Whoever knowingly and intentionally violates or attempts to violate an order issued under this section shall be fined under this title, imprisoned not more than 5 years, or both.
(d)(1) As used in this section—
(A) the term "course of conduct" means a series of acts over a period of time, however short, indicating a continuity of purpose;
(B) the term "harassment" means a serious act or course of conduct directed at a specific person that—
(i) causes substantial emotional distress in such person; and
(ii) serves no legitimate purpose;
(C) the term "immediate family member" has the meaning given that term in section 115 and includes grandchildren;
(D) the term "intimidation" means a serious act or course of conduct directed at a specific person that—
(i) causes fear or apprehension in such person; and
(ii) serves no legitimate purpose;
(E) the term "restricted personal information" has the meaning give 1 that term in section 119;
(F) the term "serious act" means a single act of threatening, retaliatory, harassing, or violent conduct that is reasonably likely to influence the willingness of a victim or witness to testify or participate in a Federal criminal case or investigation; and
(G) the term "specific person" means a victim or witness in a Federal criminal case or investigation, and includes an immediate family member of such a victim or witness.
(2) For purposes of subparagraphs (B)(ii) and (D)(ii) of paragraph (1), a court shall presume, subject to rebuttal by the person, that the distribution or publication using the Internet of a photograph of, or restricted personal information regarding, a specific person serves no legitimate purpose, unless that use is authorized by that specific person, is for news reporting purposes, is designed to locate that specific person (who has been reported to law enforcement as a missing person), or is part of a government-authorized effort to locate a fugitive or person of interest in a criminal, antiterrorism, or national security investigation.