Removed servers still showing up on report

Aug 4, 2016 at 4:34 PM
I see that the view that is using is called v_PolicyHistory_LastEvaluation and I have servers in the report/view from 6-20-16 and the servers haven't existed in a while. Any idea how these are suppose to cleared out?
Coordinator
Aug 4, 2016 at 11:03 PM
The servers are part of the data warehouse historical view which is probably why they're still showing up. I'll note this as an issue to address in future update. Thanks!

Sent from my iPhone

Oct 4, 2016 at 7:02 AM
I have a cleanupscript which I run daily to fix this kind of issues. In order to remove data from removed servers, run this:
delete
from [policy].[PolicyHistory]
where evaluatedServer not in 
(
    SELECT server_name
    FROM [policy].[pfn_ServerGroupInstances]('')
)
NOTE: policyhistorydetail will be deleted automatically because of a foreign key constraint. This may generate a lot of logging at first run.
Make sure you delete the errorhistory also:
delete
from [policy].[EvaluationErrorHistory]
where evaluatedServer not in 
(
    SELECT server_name
    FROM [policy].[pfn_ServerGroupInstances]('')

)