Dynamic Media in Configuration Manager cannot get management point locations when the Task Sequence Wizard runs in Windows PE

Applies to: System Center Configuration Manager (current branch - version 1810)System Center Configuration Manager (current branch - version 1806)System Center Configuration Manager (current branch - version 1802)

Symptoms


You use Dynamic Media in System Center Configuration Manager. When the Task Sequence Wizard first starts in Microsoft Windows Preinstallation Environment (Windows PE), the initial communication to the management point to sync the time settings is successful, as shown in the following SMSTS.log entry:


However, the later request to the management point to get location information fails, as shown in the following SMSTS.log entry:

Note The IP addresses in the first line of this log entry are the IP addresses of the client computer and its subnet.

If multiple management points are defined in the Dynamic Media, the same failure occurs regardless of which management point Configuration Manager tries to communicate with. If you try to use the same URL in a browser, as in the following example, this also causes a "500" error:

http://MP_Server/SMS_MP/.sms_aut?MPLOCATION&ir=192.168.15.100&ip=192.168.0.0

The Internet Information Services (IIS) logs on the management point do not reveal a matching "500" error entry. Instead, a "200" success entry is displayed. If you enable Failed Request Tracing in IIS for the "500" error message, you find the following error message:


For more information about how to enable failed request tracing in IIS for "500" error messages, see the Troubleshooting Failed Requests Using Tracing in IIS 8.5 topic on the Microsoft Docs website.

The MP_GetAuth.log file on the management point shows the following error entry that was logged when the client made the request that's recorded in the SMSTS.log:


The issue does not occur for site-based media or the Preboot Execution Environment (PXE) through Configuration Manager. However, the issue can occur if you use third-party PXE solutions that can use Dynamic Media.

Cause


This issue occurs because there are multiple Unknown Computer objects for a specific website, and that site has several management points. This causes many results to be returned when MPLOCATION is called and the GetMPLocationForIPSubnet stored procedure runs.

To run GetMPLocationForIPSubnet manually on the server that's running SQL Server through SQL Management Studio, run the following query:

exec GetMPLocationForIPSubnet N'192.168.0.0'

In this scenario. this command returns several hundred rows. This large number of rows exceeds the maximum buffer size. This, in turn, causes the "500" error message and also causes MPLOCATION to fail.

Resolution


All sites should have only one Unknown Computer object per architecture. For example, there should be only one x64 object that's labeled x64 Unknown Computer and only one x86 object that's labeled x86 Unknown ComputerIf a site has more than one Unknown Computer object per architecture, the extra Unknown Computer objects should be deleted. Deleting extra Unknown Computer objects can be done only from the SQL Server database. It cannot be done from the Configuration Manager console.

Note Creating extra Unknown Computer objects to prevent the client computers from "stealing" the GUID of the Unknown Computer objects is not the correct method to fix this issue. For the correct method, see the following article in the Microsoft Knowledge Base:

4471061 A client computer can "steal" the Configuration Manager GUID of an Unknown Computer object during imaging

To delete the extra Unknown Computer objects, follow these steps:

  1. Make sure you have a current and valid backup of the Configuration Manager site by using the built-in Backup maintenance task.
  2. Open the Configuration Manager console. If there are multiple Primary sites, we recommend that you open a Configuration Manager console that's connected to the central administration site.
  3. In the Configuration Manager console, go to Assets and Compliance > Overview > Device Collections.
  4. Double-click the All Unknown Computers collection.
  5. In the results pane, sort the objects in the All Unknown Computers collection by clicking the Site Code column.
  6. Note whether there are multiple x64 Unknown Computer objects or x86 Unknown Computer objects for any inidividual site.
  7. If there are multiple x64 Unknown Computer objects or x86 Unknown Computer objects for any individual site, right-click the columns in the results pane, and add Resource ID to the list of columns.
  8. Determine the lowest Resource ID value for each x64 Unknown Computer object or each x86 Unknown Computer object for any one site. In most cases, for the first Primary site in an environment, the resource IDs for the original Unknown Computer objects for the sites will be 2046820352 (x86 Unknown Computer) and 2046820353 (x64 Unknown Computer).
  9. After you determine the lowest Resource ID, all other x64 Unknown Computer objects or x86 Unknown Computer objects for any site can be deleted. Note all the Resource IDs that can be deleted and which site they belong to.
  10. Open SQL Management Studio, and then connect to the database for the site that hosts the extra Unknown Computer objects.
  11. Expand the Databases node, and select the Configuration Manager database (usually CM_Site_Code).
  12. On the toolbar, click New Query.
  13. Make sure that the correct database is selected in the drop-down menu to the left of the Execute button on the toolbar.
  14. In the query pane, run the following SQL query:
    SELECT C.CollectionID, C.SiteID, C.CollectionName, CM.MachineID, CM.Name FROM Collections CJOIN CollectionMembers CM ON C.SiteID = CM.SiteIDJOIN UnknownSystem_DISC USD ON USD.ItemKey = CM.MachineID
    This query displays all the Collections that all the Unknown Computer objects belong to. Use this query to determine which Collections the Unknown Computer objects that are being kept have to be added to. This should be based on the memberships of the Unknown Computer objects that are being deleted. The Resource ID is listed in the MachineID column.
  15. In the query pane, run the following SQL query:
    SELECT * FROM UnknownSystem_DISC WHERE ItemKey IN ('Extra_Resource_ID_1','Extra_Resource_ID_2', 'Extra_Resource_ID_3')

    In this query, Extra_Resource_ID_x is the Resource ID of each of the extra Unknown Computer objects, as determined in Step 9. For example, if the extra Resource IDs are 2046820354 and 2046820355, the query would be as follows:
    SELECT * FROM UnknownSystem_DISC WHERE ItemKey IN ('2046820354','2046820355')
  16. Verify that the records that are returned by the query in Step 15 are correct. If they are, then run the following query to delete the records:
    DELETE FROM UnknownSystem_DISC WHERE ItemKey IN ('Extra_Resource_ID_1','Extra_Resource_ID_2', 'Extra_Resource_ID_3')
    In this query, <Extra_Resource_ID_x> is the Resource ID of each of the extra Unknown Computer objects, as determined in Step 9. For example, if the extra Resource IDs are 2046820354 and 2046820355, the delete query would be as follows:
    DELETE FROM UnknownSystem_DISC WHERE ItemKey IN ('2046820354', '2046820355')
  17. Wait a few minutes, return to the Configuration Manager console, and then go to Assets and Compliance > Overview > Device Collections.
  18. Right-click the All Unknown Computers collection, and then click Update Membership.
  19. Wait a few minutes, and then click Refresh. Verify that only one x64 Unknown Computer object or x86 Unknown Computer object exists for each site.
  20. Repeat steps 10–19 for all additional Primary sites, as necessary.
     

Re-creating Unknown Computer Objects in case of accidental deletion

If, for whatever reason, all Unknown Computer objects are accidentally deleted for any one site that uses this process, they can be re-created by using the following steps. These steps should be taken only if there are no Unknown Computer objects for a site. If only one of the two Unknown Computer objects exist at a site, delete the one remaining Unknown Computer object by using the steps in the "Removing duplicate Unknown Computer objects" section, and then follow these steps:

  1. Log on to the Primary site server that the Unknown Computer objects are missing from.
  2. At an elevated command prompt, run the following command:
    REG.exe ADD "HKLM\SOFTWARE\Microsoft\SMS\COMPONENTS\SMS_DISCOVERY_DATA_MANAGER" /v CreatedUnknownDDR /t REG_DWORD /d 0 /f

After this registry key value is updated, the Unknown Computer objects should be automatically re-created soon afterward. You can check the progress of the creation of the Unknown Computer objects in the DDM.log on the Primary site server.

To speed up the re-creation of the Unknown Computer records, restart the SMS_DISCOVERY_DATA_MANAGER thread by following these steps:

  1. Open the Configuration Manager console on the Primary site  from which the Unknown Computer objects are missing, and then go to Monitoring > Overview > System Status > Component Status.
  2. On the toolbar, click Start > Configuration Manager Service Manager.
  3. In Configuration Manager Service Manager, expand the node under the site code and then click Components.
  4. In the results pane, right-click SMS_DISCOVERY_DATA_MANAGER and select Query. The thread should display as Running.
  5. Right-click SMS_DISCOVERY_DATA_MANAGER, and then click Stop.
  6. Right-click SMS_DISCOVERY_DATA_MANAGER, and then click Query.

    Note The thread should display as Stopped.
  7. Right-click SMS_DISCOVERY_DATA_MANAGER, and then click Start.
  8. Right-click SMS_DISCOVERY_DATA_MANAGER, and then click Query.

    Note The thread should display as Running.
  9. Close the Configuration Manager Service Manager window.

The Unknown Computer objects should be automatically re-created soon. You can check the progress of this process in the DDM.log on the Primary site server.