How to handle duplicate computer records in database

Anonymous
2024-01-04T18:12:46.6633333+00:00

Hi,

I'm experiencing issues with duplicate computer records.

Whenever we need to rebuild a computer, an external script deletes the old record. However, sometimes the script can't move the computer object because there are two objects in the database with the same name.

Any ideas on how to handle this?

Microsoft Configuration Manager
{count} votes

Accepted answer
  1. Sherry Kissinger 5,526 Reputation points
    2024-01-04T19:13:51.24+00:00

    I suggest working backwards. next time (or now), in the database (I assume we are talking about the CM database), check in CM for that duplicate record, and look at the properties of each record. Specifically, the Discovery information. It's possible that a stale/old record is being 'rediscovered' and kept alive in the database. Once you know what discovery is doing that, you may be able to figure out the "why". (Maybe not, but this is where I would start)

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Garth Jones 1,666 Reputation points MVP
    2024-01-05T12:33:59.0566667+00:00

    To add to Sherry's comment, It is nto supported to directly delete object via SQL, Instead you must use the ConfigMgr console or PowerShell or WMI to do it.

    Next your script should also handle it when there are two devices with the same name. It are not dups per se, as the ResourceID will be different.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.