How do you block ad-hoc distributed queries from specific sql server instances?
It's a simple setting for sp_configure (that should work for all newer versions of SQL Server - 2005, 2008, 2008 R2):

sp_configure 'show advanced options', 1;
RECONFIGURE;
sp_configure 'Ad Hoc Distributed Queries', 1;
RECONFIGURE;
GO


This will enable the use of OPENROWSET and OPENDATASOURCE.