- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
Following EPM endpoint agent upgrade or reinstall, the My Computers page of the administrator console is showing significantly more machines than before, with many showing apparent duplicate entries.
The cause:
EPM's agent has a uniquely generated Agent ID that is the primary identifier when communicating with EPM SaaS. It can be deleted with an uninstallation with specific flags across different platforms.
There are 2 levels of deletions within the DB:
In some instances, a backlog of soft-deleted items can accumulate which have not yet been hard-deleted.
During the upgrade - agents that had only been 'soft-deleted' but not yet 'hard-deleted' were added back to the "alive list". Resulting in a higher number of agents post install than had existed before.
Resolution:
When several agent duplicates exist, there could be license implications and policy targeting implications to consider, therefore ensuring you're running lean with your EPM agents is essential for success. Using EPM's APIs in a script on a periodic basis could help with keeping this agent list cleaned out in addition to EPM's already existing cleanup mechanisms.
Attached to this article is a PowerShell script written to interact with EPM's Computers APIs to ultimately deduplicate existing agents. It is purposely written to only delete duplicates and not existing agents by referencing the installation time.
Example for FedRAMP:
Note: Hard-coding credentials is NOT something that is a recommended practice and leaving them in perpetuity after use. Ideally, use a credential provider such as Idira Credential Providers, Idira Secrets Manager to replace these hard-coded credentials with API calls. However, if you don’t own these solutions, if you do paste the hard-coded credential, be sure to have a standard operating procedure of rotating that credential after use.
4. Once these values are in-place, run the script. If there are no errors returned, then you should see an output of Getting computers: currently on page X indicating which page the script is on. If no machines are to be deleted, then it will return with no results
a.Example of return without results
b. Example of return with results: