Home Asset Management

Harware Assets Renamed Daily

Nick_FlintNick_Flint Customer Advanced IT Monkey ✭✭✭
We have the Cireson Asset Management configured to create new hardware computer assets from configuration data imported by a SCCM Connector. When a computer is redeployed the windows name of the device is changed to match the new deployment. In this case, we configured CAM to update the hardware asset record with the new windows device name. What we see happening on a daily basis is the Hardware Asset Display Name and Asset Name are alternately changes from the old name to the new name. 

Have we missed something in the CAM configuration or is there something else possibly going on here?

Best Answers

  • Nick_FlintNick_Flint Customer Advanced IT Monkey ✭✭✭
    edited January 2019 Answer ✓
    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 -Descending
    foreach ($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 -Descending
    foreach ($deployedObject in $allDeployed)
    {
        $deployedObject.Group | sort-object lastmodified -Descending | Select-Object -Skip 1 | foreach {remove-scsmobject $_ -ComputerName $scsmmgmtserver -Force}
    }

Answers

  • Adam_DzyackyAdam_Dzyacky Product Owner Contributor Monkey ✭✭✭✭✭
    edited October 2018
  • Matt_MedleyMatt_Medley Member Advanced IT Monkey ✭✭✭
    We have the Cireson Asset Management configured to create new hardware computer assets from configuration data imported by a SCCM Connector. When a computer is redeployed the windows name of the device is changed to match the new deployment. In this case, we configured CAM to update the hardware asset record with the new windows device name. What we see happening on a daily basis is the Hardware Asset Display Name and Asset Name are alternately changes from the old name to the new name. 

    Have we missed something in the CAM configuration or is there something else possibly going on here?
    Hey Nick, I wanted to check in and see how things are going with this. The solution Nick provided is a great resource to delete stale / duplicate SCCM data. If you're no longer seeing this issue, please let us know. 
  • Nick_FlintNick_Flint Customer Advanced IT Monkey ✭✭✭
    edited January 2019 Answer ✓
    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 -Descending
    foreach ($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 -Descending
    foreach ($deployedObject in $allDeployed)
    {
        $deployedObject.Group | sort-object lastmodified -Descending | Select-Object -Skip 1 | foreach {remove-scsmobject $_ -ComputerName $scsmmgmtserver -Force}
    }
  • Adam_DzyackyAdam_Dzyacky Product Owner Contributor Monkey ✭✭✭✭✭
    Nice! Glad to help.
  • Matt_MedleyMatt_Medley Member Advanced IT Monkey ✭✭✭
    Glad we could get this one closed out. Thanks Adam and Nick!
Sign In or Register to comment.