Does someone have a good script/query to detect duplicate computer names and delete the ones with the older checkin times keeping the one that checked in most recent? Checkin is not always today.
Hi @sw41 ,
By default, there is a query in ePO queries and reports to find the duplicated computer names. Have you tried it?
Copy the query: 'Duplicate system Names' as you can't modify the default queries.
Modify the copy to include the column: 'Last Communication' so you can see the last communication time.
This should hopefully give you the potential list of all machines you are looking for with the time criteria included.
In server tasks you can choose to run a query with sub-actions = Delete Systems.
But that as it stands would delete *all* duplicates, not just the 'oldest' ones.
The trick is to build the query to only return the machines you want removed rather than all duplicates.
You can probably look at adding a filter to the query along the lines of:
System name is duplicated
and Last Communication is not within the last <x> days/hours
apply whatever time/date criteria you wish to apply...
Test the query *a lot* before you feed it into a server task so you don't accidentally remove the wrong machines.
I don't get the right results when filtering by date. The non persistent VDI names can have a couple in the same day based on shift change. The workstations are usually spread out date wise but the most recent may not have checked in for a day or 2 (home user leaving the computer off).
See attached script.
Was my reply helpful?
If this information was helpful in any way or answered your question, will you please select Accept as Solution in my reply and together we can help other members?