When something goes wrong and the user exits Delete-Emails incorrectly, several compliance searches can be orphaned and left behind permanently. Delete-Emails names its compliance searches something similar to delete-emails-daa2450 so that they are easy to identify, but there is no easy way to remove them all at once.
We should add a -cleanup parameter to the script which will remove all searches starting with delete-emails-* and then exit.
One consideration though is that large organizations can be running Delete-Emails many times, and using the proposed -cleanup option could remove active deletion or confirmation searches for currently running instance of Delete-Emails. Maybe by default it will only remove searches which have completed more than five minutes ago?
This feature was added in commit a33c531. It will remove all compliance searches and compliance search actions that start with "delete-emails-" and are completed.
When something goes wrong and the user exits Delete-Emails incorrectly, several compliance searches can be orphaned and left behind permanently. Delete-Emails names its compliance searches something similar to
delete-emails-daa2450
so that they are easy to identify, but there is no easy way to remove them all at once.We should add a
-cleanup
parameter to the script which will remove all searches starting withdelete-emails-*
and then exit.One consideration though is that large organizations can be running Delete-Emails many times, and using the proposed
-cleanup
option could remove active deletion or confirmation searches for currently running instance of Delete-Emails. Maybe by default it will only remove searches which have completed more than five minutes ago?