Delete "No refresh" agent

I added an agent to a template and it was set as “No Refresh”. The agent is now in a bunch of mail files. I want to get rid of the agent from the mail files is there an easier way to do it than to open each mail file in designer and delete it?

Subject: Delete “No refresh” agent

Write a LS agent to remove the faulty agent.

Use the NotesSession.GetDbDirectory to get the databases.

Use NotesDatabase.DesignTemplateName to find databases based on the template you used (assuming the databases are set to inherit from a named template).

Use the NotesDatabase.GetAgent to find the agent, and use NotesAgent.Remove to delete it.

It should be faster writing the agent, than manually going through all mail files.

/Peter