The court also sought the Centre's stand on the petitioner's allegation that Delhi Police, Indian Railways and others have created accounts on social networking sites despite government departments being barred from doing so under the law.
The court said the Information Technology (Intermediaries) Rules mandate that all social networking sites have to publish the name of grievance officer and his contact detail.
"Just because you are a foreign company, you cannot flout the law. Like us, you are bound by the rule of law of this country," the bench comprising Acting Chief Justice B D Ahmed and justice Vibhu Bakhru said, while asking the the Centre to take steps to ensure that the social networking sites comply with the Rules.
"We direct Google Inc and Facebook Inc to display the name of grievance officer on their respective sites. We also direct other intermediaries that the compliance (of the Rules) be done in two weeks," it said.
The court's direction came on a PIL filed by former BJP leader K N Govindacharya alleging that the websites have no mechanism for protection of children from online abuse.
He also submitted that government departments like Delhi Police and the Indian Railways are not entitled to create accounts on social networking sites.
The petitioner's counsel, Virag Gupta, argued that as per the rules, the Grievance Officer of the concerned website has to send an acknowledgement within 36 hours of receipt of any complaint and has to act up