msdat icon indicating copy to clipboard operation
msdat copied to clipboard

xp_cmdshell Restore Service to Identified State

Open Zamanry opened this issue 3 years ago • 0 comments

My team uses msdat non-interactively against a ton of machines using GNU's parallel command. We like to check and see if xp_cmdshell can be executed. Currently xp_cmdshell allows the user to enable or disable the xp. However, I'd like to be able to restore the xp_cmdshell to how we found it so that I am not leaving xp_cmdshell enabled if was already disabled on client environments.

So the breakdown would be:

  1. If xp_cmdshell is disabled and can be enabled:
    1. Enable
    2. Execute
    3. Disable
  2. If xp_cmdshell is enabled:
    1. Execute

Zamanry avatar Jan 30 '23 17:01 Zamanry