sp_configure 'show advanced options', 1
reconfigure

go

sp_configure 'Ad Hoc Distributed Queries', 1
reconfigure

go

sp_configure 'show advanced options', 0
reconfigure