ISSUE
SCCM client always reports to old site and management point after client installation
The background is the I was doing a migration and was moving clients from the old sccm to their new sccm. I adopted manual sccm client installation.
In the very beginning, I used the following command to install sccm client –
ccmsetup.exe /mp:newsccm.contoso.lab /forceinstall FSP=newsccm.contoso.lab SMSMP=newsccm.contoso.lab SMSSITECODE=CON
But the client still reported to the old site. The reason is that the previous trusted key of the client still points to the one coming from the old site. This situation may occur when you move a client from one site hierarchy to another. Thus, to update the trusted root key, I added the switch RESETKEYINFORMATION=TRUE to the ccmsetup.exe command –
cmsetup.exe /mp:newsccm.contoso.lab /forceinstall FSP=newsccm.contoso.lab SMSMP=newsccm.contoso.lab SMSSITECODE=CON RESETKEYINFORMATION=TRUE
However, the client still reports the old site. Th site code still shows OOE instead of CON and the assignment management point the old one instead of the assigned one in the command.
LOGS
LocationServices.log says a group policy updated the assigned site code to OOE, which is the old sccm site code.
01-28-2022 13:45:57.930 LocationServices 3632 (0xe30) LSRefreshSiteCode: Group Policy Updated the assigned site code <OOE>, which is different than the existing assigned site code <>. Will attempt re-assignment. 01-28-2022 13:45:57.992 LocationServices 3632 (0xe30) Sending Fallback Status Point message, STATEID='500'. 01-28-2022 13:45:58.195 LocationServices 3632 (0xe30) Processing GroupPolicy site assignment. 01-28-2022 13:45:58.195 LocationServices 3632 (0xe30) Assigning to site 'VN1' 01-28-2022 13:45:58.195 LocationServices 3632 (0xe30) LSIsSiteCompatible : Verifying Site Compatibility for <OOE> 01-28-2022 13:45:58.211 LocationServices 4104 (0x1008) Failed to execute task 'LSSiteRoleCycleTask'. Error 0x80004005 01-28-2022 13:45:58.211 LocationServices 4104 (0x1008) CSiteRoleCycleTask::Execute failed (0x80004005).
The resultant group policy retrieved by running gpresult /h c:\res.html has no group policies about assigning site code. After a moment of struggling, I found it related to a registry value in the following path –
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS\Mobile Client: GPRequestedSiteAssignmentCode
SOLUTION
Delete the registry value and reinstall sccm client.
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS\Mobile Client" /v GPRequestedSiteAssignmentCode /f ccmsetup.exe /mp:newsccm.contoso.lab /forceinstall FSP=newsccm.contoso.lab SMSMP=newsccm.contoso.lab SMSSITECODE=CON RESETKEYINFORMATION=TRUE
After that, the issue was gone.