Harware Assets Renamed Daily
Have we missed something in the CAM configuration or is there something else possibly going on here?
Best Answers
-
Nick_Flint Customer Advanced IT Monkey ✭✭✭Thanks, @Adam_Dzyacky. That was part of the issue I'm seeing. Besides those objects, we have computer objects with matching Serial Number but Differing names. I had to add a second step to remove the serial number duplicates. I had one group with 41, I think those are the computer objects without a serial number and I wanted to ignore virtual machines since we don't create hardware asset records for virtual computers.$scsmmgmtserver = "mgmtservername"$deployedClass = get-scsmclass -name "Microsoft.SystemCenter.ConfigurationManager.DeployedComputer" -ComputerName $scsmmgmtserver#First, remove duplicates by DisplayName$allDeployed = get-scsmobject -Class $deployedClass -ComputerName $scsmmgmtserver | group-object $_.displayname | ?{$_.count -gt 1} | sort-object lastmodified -Descendingforeach ($deployedObject in $allDeployed){$deployedObject.Group | sort-object lastmodified -Descending | Select-Object -Skip 1 | foreach {remove-scsmobject $_ -ComputerName $scsmmgmtserver -Force}}#Second, remove duplicates by SerialNumber$deployedClass = get-scsmclass -name "Microsoft.Windows.Computer$" -ComputerName $scsmmgmtserver$allDeployed = get-scsmobject -Class $deployedClass -ComputerName $scsmmgmtserver | group-object -Property SerialNumber | ?{$_.count -eq 2 -AND $_.Name -notlike "VMware*"} | sort-object lastmodified -Descending | sort-object lastmodified -Descendingforeach ($deployedObject in $allDeployed){$deployedObject.Group | sort-object lastmodified -Descending | Select-Object -Skip 1 | foreach {remove-scsmobject $_ -ComputerName $scsmmgmtserver -Force}}0
-
Haseeb_Malik Member IT Monkey ✭Hi Guys, one of the tricks to avoiding this in the first place is the process your people are using to rename computers. Firstly the trick is to rename a computer rather than move to workgroup etc. or when you're imaging, don't allow the computer to be renamed during imaging phase otherwise a new computer account will be created in AD/SCCM, leading to a new Windows Computer CI being created in the CMDB.
You'll also need to ensure you have an AD Connector setup for computers so the SID is populated in the windows computer CI and the enable the 'Before creating, check for renamed computer' in AM settings.
5
Answers
https://community.cireson.com/discussion/comment/11905#Comment_11905
You'll also need to ensure you have an AD Connector setup for computers so the SID is populated in the windows computer CI and the enable the 'Before creating, check for renamed computer' in AM settings.