Menu
CCMEXEC.COM – Enterprise Mobility
  • Home
  • General
  • Configuration Manager
  • Windows 10
  • Intune
  • GitHub
  • Windows 11
  • About the author
CCMEXEC.COM – Enterprise Mobility

Merging obsolete records in Configuration Manager 2007

Posted on March 20, 2011April 1, 2011 by Jörgen Nilsson

When reinstalling a computer which is already present in Configuration Manager 2007 it sometime obsolete the existing client record specially when reinstalling it using PXE boot. When I wanted to use Direct Membership only in a project instead of using AD-groups for instance for targeting this became a major issue.

I then found this excellent script which merge conflicting records in SCCM it can be found here: http://kristianfthomsen.spaces.live.com/blog/cns!59A30145A64F8A9F!156.entry?wa=wsignin1.0

As the site has been down the script can be downloaded here: https://ccmexec.com/wp-content/uploads/2011/04/merge.vbs.txt

The blog post tells to schedule it as a schedule task, but I love status filter rules, it is amazing what you can do with them, so I created a status filter rule which will trigger the script as soon as a duplicate record is created.
The status filter rule looks like this: MergeRecords

The only negative with this solution is that the advertisement history for the client is kept after a reinstallation which can be a bit confusing sometimes.

If you want to implement the script as a status filter rule, these are the steps:

  1. Download the script and place it in a folder on the Primary Site server in this example: “E:\sccmtools”
  2. Change the site settings to “Manually resolve conflicting records” under the Advanced tab in site properties in the SCCM Console.
    MergeRecords2
  3. Create a new status filter rule with the following properties as displayed earlier:
    Component : SMS_DISCOVERY_DATA_MANAGER
    Message ID: 2642
  4. And on the next page select that it should “Run a Program” :  “cscript.exe E:\SCCMtools\merge.vbs”
    MergeRecords3

Then you will not have any obsolete records in your SCCM site anymore.

37 thoughts on “Merging obsolete records in Configuration Manager 2007”

  1. Wayne Robinson says:
    March 27, 2011 at 11:48 pm

    Fantastic post, cant wait to give this a try 🙂

    Reply
  2. Genesis says:
    April 1, 2011 at 7:16 pm

    Can you please provide the merge script. The site that was hosting is no longer available.

    Reply
  3. Jörgen Nilsson says:
    April 1, 2011 at 11:12 pm

    Hi,
    I will update the post with the script

    /Jörgen

    Reply
  4. Stuart says:
    June 22, 2011 at 6:31 pm

    Beautiful 😉

    Reply
  5. Scott says:
    July 14, 2011 at 7:40 pm

    Can you clarify what is meant by “The only negative with this solution is that the advertisement history for the client is kept after a reinstallation which can be a bit confusing sometimes.” Does this mean that the imaged computer would not receive advertisments for software that was installed BEFORE it was imaged?

    Reply
  6. Jörgen Nilsson says:
    July 15, 2011 at 9:56 am

    HI,
    The client will run all advertisements again no problem, but if you look in the advertisement history you will have all the history left from before you reinstalled the computer. For instance if you run an advertisement for Office 2007 and after reininstallation you install Office 2010 you will have the advertisement status history for Office 2007 still in the reports and database.

    /Jörgen

    Reply
  7. Scott says:
    July 16, 2011 at 12:32 am

    Thanks for clarifying. Knowing this, I can see this script really solves a problem with ConfigMgr 2007 when it comes to imaging known computers. I have seen alot of duplicate/obsolete accounts which prevents advertisement to the new client until the obsolete account is deleted. You can delete the odsolete accounts daily with ConfigMgr but this actually PREVENTS this from occuring (even better) so advertisement happen almost immediately (R3). Nice job and thanks for sharing.

    Reply
  8. Scott says:
    July 16, 2011 at 12:35 am

    Hopefully this issue imaging known computers is resolved in ConfigMgr 2012. Anyone know?

    Reply
  9. binarymime says:
    September 30, 2011 at 4:38 pm

    Are these settings supposed to be configured on the secondary site servers as well? Or just the primary?

    Thanks

    Reply
  10. Jörgen Nilsson says:
    September 30, 2011 at 8:22 pm

    it is only needed in the primary sites.

    /jörgen

    Reply
  11. jonny says:
    October 20, 2011 at 5:51 pm

    Hello. This seems nice. But I do have too edit the .vbs with correct settings for my site?

    Reply
  12. Jörgen Nilsson says:
    October 20, 2011 at 10:26 pm

    Hi,
    No modifications the vbscript is needed, there is no site specific information in there.
    /Jörgen

    Reply
  13. Kathy says:
    November 14, 2011 at 11:20 pm

    I have set this script up per the instructions and it does not seem to be working. I have duplicate machine listings. The machines have different versions of the client. Does this make any difference. I hope to get this to work as this is exactly what I need.

    Reply
  14. Jörgen Nilsson says:
    November 14, 2011 at 11:22 pm

    Hi,
    Kathy, are you sure the objects in your environment are obsoleted? otherwise they will not be merged..

    /jörgen

    Reply
  15. Kathy says:
    November 15, 2011 at 2:18 pm

    Yes they are obsolete. We are getting ready to deploy Windows 7 and applications and the once Windows 7 creates a new client then the one that is in the application collection is obsolete and the package will not deploy. There is no message id 2642 as is suggested in the status filter I think that may be my problem. If it does not generate that ID then it will not run the script, correct?

    Reply
  16. Jörgen Nilsson says:
    November 16, 2011 at 7:24 am

    Hi,
    Again Kathy, that is correct the script is triggered by the status message, do you have any records in the “Conflicting Records” node in the SCCM console?
    /Jörgen

    Reply
  17. Kathy says:
    November 16, 2011 at 2:22 pm

    Yes I did this morning and the other packages that I tried to deploy showed no status since yesterday.

    Reply
  18. binarymime says:
    November 16, 2011 at 3:48 pm

    It’s not working for me either. I have had the script in play for about a month now and the conflicting records are showing up, they are just not automatically resolving themselves via the script. I am having to manually Merge them. Any insight. One thing i am a bit confused on…how long does it take for an obsolete record to actually be marked obsolete?

    Reply
  19. binarymime says:
    November 16, 2011 at 4:10 pm

    Further update to this. I checked in event viewer and filtered 2642 event ids for the SMS_DISCOVERY_DATA_MANAGER component and found nothing…any idea as to why these would not be generated?

    Reply
  20. Kathy says:
    November 16, 2011 at 7:14 pm

    I can manually run the script and it works just not through the status filter rule.

    Reply
  21. John Rolstead says:
    December 13, 2011 at 8:11 pm

    You must set Site properties\Advanced\”Manually resolve conflicting records” to get the event ID 2642 for the SMS_DISCOVERY_DATA_MANAGER component.

    Reply
  22. Peter says:
    January 12, 2012 at 5:58 am

    Hi, this looks really promising, but my problem records are technically not Obsolete, they have a blank in that column and no SMSID at all, they dont even have the same site code, but they do have the same hostnames and obvious causes me grief for the same reasons as an Obsoletely marked record would.

    Will the script merge my records even if the Obsolete column is blank for the problem records?

    Thanks

    Reply
  23. andy says:
    January 13, 2012 at 5:08 pm

    Hi,

    Same deal with me, I can manually run the script and it works just not through the status filter rule.
    I can see the 2642 event in status filter under SMS_DISCOVERY_DATA_MANAGER. Do I need to restart a service?

    Reply
  24. andy says:
    January 17, 2012 at 9:17 pm

    Issue fixed, by using the full path: C:\Windows\SysWOW64\cscript.exe D:\SCCM\Scripts\merge.vbs

    Reply
  25. binarymime says:
    February 9, 2012 at 4:14 pm

    I am still not able to find any 2642 events although i am getting conflicting records…im so confused, i have changed the pathing according to andy and hopefully that will fix it

    Reply
  26. binarymime says:
    February 9, 2012 at 4:15 pm

    Also, what is the difference between the script above and the one provided here:

    http://blogs.technet.com/b/configmgrteam/archive/2011/08/17/known-issue-and-workaround-duplicate-records-when-you-use-unknown-computer-support-with-active-directory-delta-discovery.aspx

    Reply
  27. binarymime says:
    February 22, 2012 at 4:09 pm

    Okay i see the event id 2642 and i have setup the status filter rule…however the script is not running, i am using the path:

    C:\Windows\SysWOW64\cscript.exe E:\Source\Scripts\merge.vbs

    Any additional suggestions?

    Reply
  28. Herwin says:
    May 3, 2012 at 1:10 pm

    Hi

    I setup the filtered rule as explained, and it is working like a charm!!

    running SCCM 2007 R3 and scriptpath is C:\Windows\SysWOW64\cscript.exe E:\Source\Scripts\merge.vbs

    Thanks!,

    Reply
  29. Pingback: Problem SCCM Records « ConfigMgr in the real world
  30. eric says:
    August 2, 2012 at 11:38 am

    Hello,

    i have clients in some dynamic collections (AD) and also in static collections. Is the client after the merge in all related collections?

    Regards Eric

    Reply
    1. Jörgen Nilsson says:
      August 2, 2012 at 11:48 am

      Hi,
      Yes the client will still be member of exactly the same collections as the old SCCM object is kept.
      /Jörgen

      Reply
  31. mbroome says:
    September 17, 2012 at 8:44 pm

    Dim swbemLocator
    Dim swbemServices
    Main()
    Sub Main()
    Dim oProviderLocation
    Dim oLocation
    Dim oReg
    Dim oPendingRegs
    Set swbemLocator = CreateObject(“WbemScripting.SWbemLocator”)
    swbemLocator.Security_.AuthenticationLevel = 6 ‘Packet Privacy.
    Set swbemServices = swbemLocator.ConnectServer(“.”, “root\SMS”)
    Set oProviderLocation = swbemServices.InstancesOf(“SMS_ProviderLocation”)
    For Each oLocation In oProviderLocation
    If oLocation.ProviderForLocalSite = True Then
    Set swbemServices = swbemLocator.ConnectServer(oLocation.Machine, “root\sms\site_” + oLocation.SiteCode)
    End If
    Next
    Set oPendingRegs = swbemServices.ExecQuery(“SELECT * FROM SMS_PendingRegistrationRecord”)
    For Each oReg In oPendingRegs
    Resolve 1, oReg.SMSID
    Next
    End Sub
    Sub Resolve(action, SMSID)
    Dim InParams
    Set InParams = swbemServices.Get(“SMS_PendingRegistrationRecord”).Methods_(“ResolvePendingRegistrationRecord”).InParameters.SpawnInstance_
    InParams.Action = action
    InParams.SMSID = SMSID
    swbemServices.ExecMethod “SMS_PendingRegistrationRecord”,”ResolvePendingRegistrationRecord”, InParams
    End Sub

    Reply
  32. MC says:
    October 1, 2012 at 5:06 pm

    Jörgen

    Could the script not be amended to clear the advertisment history to prevent the shortcoming you mention?

    Reply
  33. Joe says:
    February 20, 2013 at 4:10 pm

    Jorgen this is very nice something I wish I wouldve found 2 years ago, anyways do you know if this is used in the same fashion on 2012 we are in the process of migrating and Im not yet very familiar with the way 2012 handles this.

    Reply
  34. cary says:
    July 22, 2013 at 5:15 pm

    Hello Jorgen, question for you regarding this process. We have 2 07 primaries; 1 is parent (for reporting) and the other is child (where all operations occur). I am assuming this would need to be setup on the parent but curious if it needs to be on both or just one. Please let me know when you have a chance. Thanks….

    Reply
  35. Peatrick says:
    August 1, 2013 at 7:00 pm

    work in SCCM 2012? I have the same problem.

    Reply
  36. Pingback: Automatically merge conflicting records - Workplace Vision

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

My name is Jörgen Nilsson and I work as a Senior Consultant at Onevinn in Malmö, Sweden. This is my blog where I will share tips and stuff for my own and everyone elses use on Enterprise Mobility and Windows related topics.
All code is provided "AS-IS" with no warranties.

Recent Posts

  • Install New Teams client with PowerShell with or without content
  • Community tools demoed at WPNinjas 2023
  • PowerShell script to keep Personal Teams away in Windows 11
  • Windows 11 Multi-App kiosk – a first look
  • Playing around with Driver Updates in Intune

©2023 CCMEXEC.COM – Enterprise Mobility | WordPress Theme by Superb Themes
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.Accept Reject Read More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT