cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Level 10
Report Inappropriate Content
Message 1 of 5

Delete Duplicate Named computers

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.

4 Replies
Highlighted
McAfee Employee
McAfee Employee
Report Inappropriate Content
Message 2 of 5

Re: Delete Duplicate Named computers

Hi @sw41 ,

Greetings!

By default, there is a query in ePO queries and reports to find the duplicated computer names. Have you tried it?

Was my reply helpful?

If you find this post useful, please give it a Kudos! Also, please don't forget to select "Accept as a Solution" if this reply resolves your query!
Highlighted
McAfee Employee
McAfee Employee
Report Inappropriate Content
Message 3 of 5

Re: Delete Duplicate Named computers

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.

Hth





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?
Highlighted
Level 10
Report Inappropriate Content
Message 4 of 5

Re: Delete Duplicate Named computers

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).

Highlighted
McAfee Employee
McAfee Employee
Report Inappropriate Content
Message 5 of 5

Re: Delete Duplicate Named computers

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?

You Deserve an Award
Don't forget, when your helpful posts earn a kudos or get accepted as a solution you can unlock perks and badges. Those aren't the only badges, either. How many can you collect? Click here to learn more.

Community Help Hub

    New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

  • Find Forum FAQs
  • Learn How to Earn Badges
  • Ask for Help
Go to Community Help

Join the Community

    Thousands of customers use the McAfee Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

  • Get helpful solutions from McAfee experts.
  • Stay connected to product conversations that matter to you.
  • Participate in product groups led by McAfee employees.
Join the Community
Join the Community