---
title: "Sanitize Agent Script"
url: "https://dm0bkdes5q7a2ls.productfruits.help/en/article/sanitize-agent-script"
language: "en"
last_updated: "2026-11-05T21:44:38.370Z"
---

# Sanitize Agent Script

The latest Sanitize Agent script, SanitizeAgent_13.6.1.ps1, is targeted for SDP/Greyhound-era Agent cleanup, especially around interrupted scans and distributed-search state.

The latest Sanitize Agent script, `SanitizeAgent_13.6.1.ps1`, is targeted for SDP/Greyhound-era Agent cleanup, especially around interrupted scans and distributed-search state.

The script is meant to clear stale distributed search/task/progress state without wiping the entire Console application folder.

## What does the Updated Sanitize Agent Script Do?

This is a Spirion Agent cleanup/sanitize script for Windows Agents.

Note the following key points about the script:

1.  It requires **Administrator** rights.
2.  It **clears** the console screen.
3.  It **Force-stops** these processes if they are currently running:
4.  1.  `IdentityFinderCmd`
    2.  `IdentityFinder`
    3.  `idfEndpoint`
5.  It **Stops** the following service:
6.  1.  `IdentityFinderMessagingService`
7.  It **deletes** these folders if they exist on the Agent machine:
8.  1.  C:\\ProgramData\\Identity Finder\\Application\\Console\\DistributedSearchInfo
    2.  C:\\ProgramData\\Identity Finder\\MCData
    3.  C:\\ProgramData\\Identity Finder\\Tasks
    4.  C:\\ProgramData\\Identity Finder\\TasksMonitor
    5.  C:\\ProgramData\\Identity Finder\\ScanProgress
    6.  C:\\ProgramData\\Identity Finder\\AdminData
    7.  C:\\Windows\\Temp\\IDFTmpDir
    8.  %TEMP%\\IDFTmpDir
9.  The script **restarts** the following services:
10.  1.  `IdentityFinderMessagingService`
     2.  `IdentityFinderEndpointService`
11.  The script **writes** an empty marker/log file such as:
12.  1.  C:\\ProgramData\\Identity Finder\\Logs\\SanitizeAgent.MMddyyyy.HHmmss.txt

## Key differences from SanitizeAgentv2 1.ps1

Compared with the older v2 script the latest script:

-   Stops/starts `IdentityFinderMessagingService` instead of `IdentityFinderService`.
-   Deletes only `Application\Console\DistributedSearchInfo` instead of the broader `Application\Console` folder.
-   Explicitly deletes the directory `C:\Windows\Temp\IDFTmpDir`.
-   Writes a timestamped text file - `SanitizeAgent...txt` - to the directory "C:\\ProgramData\\Identity Finder\\Logs"
-   As with previous scripts this script still restarts the service `IdentityFinderEndpointService`.
