SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Check if xp_cmdshell is turned on and flip the bit

By Edward Pochinski,

In some shops \ cases this feature may be turned off as part of the security regulations. You may need to flip xp_cmdshell on to perform a piece work and then flip the bit back when the work is done. You can also tweak the code to flip the bit off again when done. Simple, non complex script but very effective in an automation task. The script uses sys.configurations to check the bit set for the xp_cmdshell feature, if the value = 0 we turn it on.  I hope you will find some use for the code.

Total article views: 304 | Views in the last 30 days: 2