Video Screencast Help
Give us your opinion and win with Symantec! Please help us by taking this survey to tell us about your experience with Symantec Connect, so that we can continue to grow and improve.  Take the survey.

How to delete policy targets with SQL?

Created: 01 Apr 2014 | 6 comments

I'm trying to write a script that will clean up our policy targets.  Is there a way to delete a target from the policy using SQL?

Operating Systems:

Comments 6 CommentsJump to latest comment

andykn101's picture

Rumour has it that SP1 to 7.5 will be out in the summer and will let you edit Targets directly.

To delete a Target from a policy using SQL you'd need to look at Resource Associations would be my guess but manipulating the SQL database directly is risky.
 

Authorised Symantec Consultant (ASC) with Endpoint Management Limited, an Authorised Symantec Delivery Provider based in the UK.

Connect Etiquette: Please "Mark as Solution" posts that fix your problem.

SK's picture

Because if you dont do it correctly you will remove the target from policies that actually need it too.

Connect Etiquette: "Mark as Solution" those posts which resolve your problem, and give a thumbs up to useful comments, articles and downloads.

ayockcelg's picture

Do you know the table that actually contains the targets?

I would like to experiment with removing them.

andykn101's picture

Objects in the database can be spread across more than one table. So the table containing the Targets might be little more than a list of GUIDs, the name of the Target could be in another table and the relationship between the Targets and Policies in another. And then there's the security records too, probably another table, then the history records.

If you just delete the targets from one table all these other records will be left behind.
 

Authorised Symantec Consultant (ASC) with Endpoint Management Limited, an Authorised Symantec Delivery Provider based in the UK.

Connect Etiquette: Please "Mark as Solution" posts that fix your problem.

Pascal KOTTE's picture

Hi all, what I do, I do not "delete", because I find we got enough "red" in logs, without playing such...

But I alter to rename the filter to prefix them "zzz_" stopping mismatch me...

Of course, must be SQL admin to proceed...

Here the SQL to get the list, you can extend a WHERE condition on the name, with your own naming convention prefix you are using (you should had...;)

SELECT     ModifiedDate, Alias, Description, Name, Guid, ClassGuid
FROM         vItem
WHERE     (ClassGuid LIKE N'D1D31520-C3AE-471D-BE99-D0FF1221BBCA')
ORDER BY Name

~Pascal @ Kotte.net~ Do you speak French? Et utilisez Altiris: venez nous rejoindre sur le GUASF