• SQL Server already keeps track of this in the SQL Error Log. SQL Server adds an entry to the Error Log whenever a server configuration option changes.

    What are you trying to accomplish by implementing a trigger? Policy Based Management may be able to help you here if you're trying to prevent someone from enabling or disabling xp_cmdshell.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato