The preliminary injunction issued in Los Angeles Superior Court on Monday requires that Dessarae Bradford, 31, stay at least 150 yards away from Farrell, his 2-year-old son and the toddler's mother, model Kim Bordenave.
The order expires in August 2009.
Bradford confronted the Irish actor on July 20 after walking onto the "Tonight" set at the NBC studios in Burbank. She was a ticketed member of the audience.
Farrell escorted Bradford offstage and NBC security personnel took her off the premises.
In a statement to The Associated Press, Bradford said she would ask the court to set aside the restraining order.
Farrell's publicist, Danica Smith, could not immediately be reached for comment.