I'd been spilling over this one on and off for a while when I discovered that these machines were appearing in "Conflicting Records".
|Conflicting Records within SCCM console|
You have a few options here. We can get SCCM to manage conflicting records by chaging the setting site wide:
- Navigate to System Center Configuration Manager / Site Database / Site Management / <site code> - <site name>
- Right-click <site code> - <site name> and then click Properties.
- Under the "Advanced" tab, you can choose Manually resolve conflicting records or Automatically create new client records for duplicate hardware IDs.
From conflicting records as above select the conflicting record and look in the actions pain and you will see few options:
- Merge - combines the new record with the existing one merging together
- New - creates a brand new record for the conflict
- Block - creates a new record but blocks it
- Save this into a file called "Merge.vbs" to somewhere of your choice - we will be using it in a few steps time - don't forget to check your formatting if you copy and paste - the "quotes" can sometimes 'mess up' etc
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)
Set oPendingRegs = swbemServices.ExecQuery("SELECT * FROM SMS_PendingRegistrationRecord")
For Each oReg In oPendingRegs
Resolve 1, oReg.SMSID
Sub Resolve(action, SMSID)
Set InParams = swbemServices.Get("SMS_PendingRegistrationRecord").Methods_("ResolvePendingRegistrationRecord").InParameters.SpawnInstance_
InParams.Action = action
InParams.SMSID = SMSID
swbemServices.ExecMethod "SMS_PendingRegistrationRecord","ResolvePendingRegistrationRecord", InParams
- Ensure that conflicting records on the advanced tab of site properties is still set to "Manually Resolve Conflicting Records"
- Create a new status filter rule with the following properties:
Message ID: 2642
- On the actions tab select "run a program" and specify the above script we created. If on a x64 server you may need to specify the full path to "cscript.exe" i.e. “C:\Windows\SysWOW64\cscript.exe C:\SCCMTools\Merge.vbs”