Harvey Weinstein will be able to gain access to old emails and files from The Weinstein Company as he attempts to defend himself against criminal investigations.

U.S. Bankruptcy Court Judge Mary Walrath made the ruling this afternoon at the federal courthouse in Wilmington, DE, accepting the disgraced media mogul’s request for collecting them provided he cover all the costs and that he, the Weinstein Co and unsecured creditors make specific arrangements. The information will be limited to emails between Weinstein and alleged victims.

“I think that Mr. Weinstein is entitled to a copy of emails,” Walrath said.

Fourteen parties who have filed lawsuits against Weinstein will also be allowed to see the emails produced. Walrath recommended a protective order to prevent them from being released in the media.

Weinstein filed his motion last month, arguing the emails could produce exculpatory evidence that could be beneficial for him and TWC, and hired former O.J. Simpson attorney Alan Dershowitz to help. Dershowitz was not present at the hearing today – attorney Scott Cousins said he was in Israel.

The Weinstein Co. asked  the court to reject Weinstein’s motion, saying it would cost $750,000 or more to review some 800,000 documents on his email accounts and make the necessary redactions of privileged or protected information — money that hasn’t been provided for under the company’s bankruptcy financing.

Multiple times Tuesday, Cousins said Weinstein had rights and deserved fair treatment while acknowledging the tremendous hit the producer’s reputation has taken.

“Probably outside of Mr. [Eric] Schneiderman and Mr. [Bill] Cosby,” he said, “Mr. Weinstein is probably not the most treasured person in the U.S. right now.”

At another point while giving his argument, Cousins said the emails would be very important “for the pre-sentencing.” Walrath and the other attorneys in the courtroom laughed.

“I was jumping a little bit ahead,” Cousins said. “I meant pre-charge.”

Alan Kornfeld, an attorney for the unsecured creditors committee, which includes two accusers, emphasized the 14 parties who have filed civil suits against Weinstein needed access to the emails.

“Harvey Weinstein first of all is not the victim here,” he said. “The victims are those who were victimized by sexual misconduct.”

Weinstein has said he needs access to his old e-mails and files to defend himself amid ongoing federal and state criminal investigations in New York, Los Angeles and London.