Today, I had problem installing CM client on a machine. Both manual install and client push methods did not work. I checked the ccm.log file on the SCCM server and found this error.
The error code indicates that the WMI repository on the client is broken. In order to fix this error, we have to rebuild the WMI repository.
I run the Windows commmand (cmd.exe) as a local administrator and try these commands.
- winmgmt /verifyrepository
- winmgmt /salvagerepositor
The first command checks for the consistency of the WMI repository and the second command rebuilds the repository if an inconsistency is detected.
However, these commands do not fix the problem for me. So I end up with rebuilding the WMI repository manally by follow these steps.
- Change the startup type of the Windows Management Instrumentation to Disabled and stop this service
- Go to %windir%\System32\wbem and rename the Repository folder to Repository.bak
- Run the cmd.exe as administrator and CD to %windir%\System32\wbem
- Run for /f %s in (‘dir /b /s *.dll’) do regsvr32 /s %s
- Change the startup type of the Windows Management Instrumentation back to Automatic
- In the cmd.exe windows, run cd /d C:\ to go back to the root of the C drive
- Run for /f %s in (‘dir /s /b *.mof *.mfl’) do mofcomp %s
- Reboot the machine
After reboot the machine, I push the CM client to the machine again and it works. Yay!
Written in C#, this application scans the Uninstall registry keys under HKLM to find all information about installed applications on a machine. It’s very helpful when we want to look for the UninstallString, which can be used as the uninstall command of a SCCM application.
I wrote this application because it takes too long for me to look for the UninstallString of an application every time I create an SCCM application.
Note: This application requires .NET Framework 3.5
The Windows Update tab searches for all Windows updates on the machine. In order to use it, you have to set the ExecutionPolicy to RemoteSigned, Bypass or Unrestricted (not recommended) on your machine.
Today I did some testing with installing an application in SCCM using PowerShell. I found out a few interested things and I want to share it with you guys.
In order for an application to be successfully installed, there are few things that we have to setup.
1. Change the PowerShell execution policy
From Client Settings, change the PowerShell execution policy to Bypass in the Computer Agent category.
If we don’t do this, we’ll get an error message when trying to install the application from the application catalog.
The error is also captured in the AppDiscovery.log file on the client.
Note: You may not have to do step 1, if you don’t use PowerShell script for application detection.
2. Include the Bypass ExecutionPolicy in the install command
If you don’t set the PowerShell ExecutionPolicy to Bypass or Unrestricted on your machine, you have to include it in the install command similar as below.
powershell.exe -ExecutionPolicy Bypass -file “.\Install.ps1”
If not, you will get an unmatched return code 1 error, captured in the AppEnforce.log file.