Good morning everyone,
We use a report that includes the table Evt_NS_Client_Config_Request in an automation policy to automatically set Active computers that have not requested a configuration in 30 days to missing and generate a service desk ticket. Using the default data purge policy we run into issues where we have more configuration requests then the table is set to hold by default. Normally when an asset is checking in properly this isn't a problem as old config request events get purged and the recent ones are kept. In the case of missing computers there have been times where an asset never goes missing because the last time it checked in has been purged before the job ran to mark it as missing and it doesn't show on the report. Initally my thought was to just set the purge setting to not purge data out for 45 days. This makes sure the data exists in the table so the asset can be marked as missing. While this does technically solve the problem we have almost 3 million rows in the Evt_NS_Client_Config_Request table.
So I had a thought, why not manually purge out this table using a scheduled job in SQL so that only the most recent config request is kept in the database, I can then run this once a day and ultimately solve the problem.
My SQL is pretty basic for this: