Article ID: 000087537 Content Type: Error Messages Last Reviewed: 10/27/2021

Why are Intel® Endpoint Management Assistant (Intel® EMA) Endpoints Showing Duplicated After Re-imaging?

Environment

Windows® 10*, Windows® 10, 32-bit*, Windows® 10, 64-bit*

BUILT IN - ARTICLE INTRO SECOND COMPONENT
Summary

Process step to resolve duplicates within databases

Description
  • Unable to make existing endpoints recognized in the Intel® Endpoint Management Assistant (Intel® EMA) console, after operating system (OS) is re-imaged in endpoint
  • Unable to make the duplicate endpoints entries to consolidate after the endpoint is been re-imaged
Resolution

This is for the duplicate entries in Intel EMA that happen due to re-imaging a client that has already been provisioned.

To avoid this, it's recommended to unprovision a system prior to re-imaging. But if you don't do this and re-image the system, duplicates will get created in the database causing issues.

In case the endpoints were not unprovisioned prior to the re-image process, the following script could be used.

Note

This is an internally developed script and is not fully tested. You may use at own risk.

Back up the SQL server's databases, including the EMA database prior to running the script or test the process in a test environment first.

IF OBJECT_ID(N'tempdb..#Temp_UniqueEndpoints') IS NOT NULL

BEGIN

DROP TABLE #Temp_UniqueEndpoints

END

GO

SELECT

     ComputerName

     , NodeIdentity

     , NodeId

INTO #Temp_UniqueEndpoints

FROM

     Nodes

     , (

          SELECT

               MAX(NodeIdentity) AS EndpointID

          FROM

               Nodes

          GROUP BY

               ComputerName

     ) TopNodes

     , (

          SELECT

               ComputerName AS EndpointName

               , COUNT(ComputerName) AS Duplicate

          FROM

               Nodes

          GROUP BY

               ComputerName

          HAVING

               COUNT(ComputerName) > 1

     ) EndpointDups

WHERE

     Nodes.NodeIdentity = TopNodes.EndpointID

AND

     Nodes.ComputerName = EndpointDups.EndpointName;

IF OBJECT_ID(N'tempdb..#Temp_DuplicateEndpoints') IS NOT NULL

BEGIN

DROP TABLE #Temp_DuplicateEndpoints

END

GO

SELECT

     Nodes.ComputerName

     , Nodes.NodeIdentity

     , Nodes.NodeId

     , UniqueEP.NodeId AS UniqueId

     , DupCount = ROW_NUMBER() OVER (PARTITION BY

Nodes.ComputerName ORDER BY Nodes.LastUpdate)

INTO #Temp_DuplicateEndpoints

FROM

     Nodes, #Temp_UniqueEndpoints AS UniqueEP

WHERE

     Nodes.ComputerName = UniqueEP.ComputerName

AND Nodes.NodeIdentity NOT IN(

                         SELECT

                              NodeIdentity

                         FROM

                              #Temp_UniqueEndpoints

                         )

ORDER BY

     Nodes.NodeId;

-- Update and Remove Duplicate Endpoints

DELETE FROM

     [Manageability].[Amt8021XSetup_IntelAmtSetup]

WHERE

     NodeID in (SELECT NodeID FROM #Temp_DuplicateEndpoints);

UPDATE

     IntelAmtSetup

SET

     IntelAmtSetup.NodeID = Duplicates.UniqueId

FROM

     #Temp_DuplicateEndpoints AS Duplicates

WHERE

     IntelAmtSetup.NodeID = Duplicates.NodeID

AND

     Duplicates.DupCount = 1

AND

     Duplicates.UniqueId NOT IN (

          SELECT

               NodeId

          FROM

               IntelAmtSetup

               );

UPDATE

     EndpointConnectInfo

SET

     EndpointConnectInfo.NodeID = Duplicates.UniqueId

FROM

     #Temp_DuplicateEndpoints AS Duplicates

WHERE

     EndpointConnectInfo.NodeID = Duplicates.NodeID

AND

     Duplicates.DupCount = 1

AND

     Duplicates.UniqueId NOT IN (

          SELECT

               NodeId

          FROM

               EndpointConnectInfo

               );

UPDATE

     AmtCertMap

SET

     AmtCertMap.NodeID = Duplicates.UniqueId

FROM

     #Temp_DuplicateEndpoints AS Duplicates

WHERE

     AmtCertMap.NodeID = Duplicates.NodeID

AND

     Duplicates.DupCount = 1

AND

     Duplicates.UniqueId NOT IN (

          SELECT

               NodeId

          FROM

               AmtCertMap

               );

DELETE FROM

     IntelAmt

WHERE

     IntelAmt.NodeID IN (

          SELECT

               NodeId

          FROM

               #Temp_DuplicateEndpoints

          );

DELETE FROM

     Nodes

WHERE

     Nodes.NodeID IN (

          SELECT

               NodeId

          FROM

               #Temp_DuplicateEndpoints

          );

-- Debug Output

SELECT * FROM #Temp_UniqueEndpoints

SELECT * FROM #Temp_DuplicateEndpoints

-- Debug Output

DROP TABLE #Temp_UniqueEndpoints

DROP TABLE #Temp_DuplicateEndpoints

Related Products

This article applies to 1 products