exec sp_configure 'show advanced options', 1 go RECONFIGURE WITH OVERRIDE go exec sp_configure go exec sp_configure 'Ad Hoc Distributed Queries', 0 exec sp_configure 'clr enabled', 0 exec sp_configure 'cross db ownership chaning', 0 exec sp_configure 'Ole Automation Procedures', 0 exec sp_configure 'SQL Mail XPs', 0 exec sp_configure 'xp_cmdshell', 0 go RECONFIGURE WITH OVERRIDE go exec sp_configure go