SCORCH turn on/off object specific logging

Hey there!

So sometimes when developing in Orchestrator you turn on object specific logging in order to debug something. It happend to me many times I forgot to turn it off, and then you forget which runbooks you turned it on for. Here’s a SQL query to execute against Orchestrator’s DB that turns off for all runbooks.

Use Orchestrator /* your DB name may vary */

DECLARE @id UNIQUEIDENTIFIER

DECLARE @name NVARCHAR(MAX)

DECLARE curs CURSOR FOR

SELECT

UniqueId, Name

FROM

POLICIES

WHERE

LogSpecificData = 1 /* Change this to 0 if disable, 1 to enable */

OPEN curs

FETCH NEXT FROM curs

INTO @id, @name

WHILE @@FETCH_STATUS = 0

BEGIN

PRINT ‘Changing settings of Specific Data Logging For : ‘ + @name

UPDATE POLICIES

SET LogSpecificData = 0

WHERE UniqueID = @id

FETCH NEXT FROM curs

INTO @id, @name

END

CLOSE curs

DEALLOCATE curs

 

Mind my comments within the code. I recommend to test this query in test environment first before going to production.

 

Cheers!

Robot(ICT) guy

Published by

Lukas Vu

I started in IT with my own business since high school providing automated and centralized hosting solutions to end customers. Nowadays I'm focusing on corporate area, analyzing, managing and improving customer's IT environments. My main focus nowadays is automation and architectural improvements.

Leave a Reply

Your email address will not be published.