WMI Repository Corrupt

Been struggling to install the SCCM Client on a Windows Server 2008 R2 server for 2 months. Recently had a maintenance window where I could determine why the SCCM Client was not installing to this server.
Examined it further and found the below.

Problem

The below is from the C:\Windows\CCMSetup\CCMSetup.log file.

Error – Failed to open to WMI namespace ‘\\.\root\cimv2’ while trying to remotely install the SCCM Client.

WMIRepoCorrupt#1

The WMI Repository is corrupt. No matter what you do you wont be able to install the client, unless you do the below.

Solution

Open a Command Prompt as an Administraor and run the following command:

Winmgmt /resetrepository

This will reset the WMI Repository back to the initial state when the operating system is first installed.
This is a safer and better way than deleting the WMI Repository like some forums suggest.

OnSearchComplete – Failed to end search job

Currently patching an environment that has not been receiving patches regularly. 30 servers. Not a big deal, but some Windows Server 2008 R2 ones, which are always fun due to the update process.

Noticed that updates were not going out to a bunch of Windows Server 2008 R2 servers that were configured (Deployment Package) after the rest.

Thought it was my Deployment Package, so redeployed the Deployment Package with more certainty and confidence.
Still no luck. Decided to check the SCCM logs.
Checked the WUAHandler.log under C:\Windows\CCM\Logs and found that the below error:

OnSearchComplete – Failed to end search job. Error = 0x80072efe
Scan failed with error = 0x80072efe

SCCMError#1

This error indicates an issue talking to the WSUS server. For my particular case the WSUS App Pool was stopped, meaning it couldn’t communicate with it.

Start the App Pool and it fixes the problem. If the application pool is running for you then check you can connect to the WSUS URL, eg. http://:8530 remotely from the client and troubleshoot that way.

You can confirm this by checking C:\Windows\CCMCache and looking at the timestamp for the updates coming in.

SCCMError#2.png

SCCM Updates in an Offline Environment

I currently have an SCCM 1702 install in an offline environment (offline meaning no internet access).
If we look at the current lifecycle as listed below in Figure 1, 1702 isnt supported and wont be getting updates, and that’s not a good thing. So its time to apply the updates to get it SCCM version 1902 at a minimum.

SCCMOfflineEnvironment#1
Figure 1 – accurate as of 17th Aug 2019.

Reference – https://docs.microsoft.com/en-us/sccm/core/servers/manage/current-branch-versions-supported

In order to get the SCCM files in an offline environment, I need to export the Telemetry data to send to Microsoft and in return provide the physical CAB files to import into my offline environment.

The process to do this is:

Pre-Reqs:

Service Connection Point in SCCM is installed and set to Offline, On-demand connection.

Local Administrator permissions.

Read permissions to the SCCM database.

D:\ServiceConnectionTool folder is created.

Steps:

Open a command prompt as an administrator.

Navigate to the <installmedialocation>\SMSSETUP\Tools\ServiceConnectionTool

Run the following command:

ServiceConnectionTool.exe -prepare -usagedatadest D:\ServiceConnectionTool\UsageData.cab

Copy the Service Connection Tool folder (including the DLLs) to a USB drive and the UsageData.cab.

Go to an internet connected machine, and plug in the USB.

Open a command prompt as an administrator and the following:

Serviceconnectiontool.exe -connect -usagedatasrc D:\ServiceConnectionTool\UpdatePacks

Microsoft will then provide the updates for SCCM onto the USB so make sure you have space on the USB.

Connect the USB to the SCCM machine and open command prompt as an administrator and run the following command:

ServiceConnectionTool.exe -import -updatapacksrc D:\ServiceConnectionTool\UpdatePacks

Open the SCCM Console and go to Administration > Updates and Servicing.
You will now see the updates.