Viacom has taken Google to court over copyright infringements on YouTube. It is suing for $1bn.
A judge has ordered YouTube to hand over the computer logs, which include IP addresses, YouTube account details, email addresses, and a history of every video and who has watched it.
Civil rights advocates are disappointed by the decision, and have warned that it could be in breach of privacy laws.
Kurt Opsahl, a lawyer for the Electronic Frontier Foundation, which campaigns for online freedom, said: "The court's erroneous ruling is a set-back to privacy rights, and will allow Viacom to see what you are watching on YouTube.
"We urge Viacom to back off this overbroad request and Google to take all steps necessary to challenge this order and protect the rights of its users."
No doubt wary of a backlash against it by YouTube's millions of fans worldwide, Viacom has said that it did not ask for the personal data and blamed Google for putting it in that situation.
It said: "Any information that we or our outside advisors obtain -- which will not include personally identifiable information -- will be used exclusively for the purpose of proving our case against You Tube and Google, will be handled subject to a court protective order and in a highly confidential manner."
Figures from Nielsen Online show that during May 130.1m people from around the world visited YouTube, spending an average of 49 minutes on the site.
Viacom launched its lawsuit against YouTube in March 2007. It accused the video-sharing website of "massive intentional copyright infringement" by showing almost 160,000 unauthorised clips from its programmes, which include 'Jackass', 'Beavis and Butt-head' and 'SpongeBob SquarePants'.