ConfigMgr 2007: Unable to open Configuration Manager Console, error: MMC Cannot Initialize the Snap-in

Today's troubleshooting tip comes from Clifton Hughes, a real life Senior Support Engineer from our Las Colinas office.  If you're having trouble getting the ConfigMgr 2007 admin console installed and running then you'll want to take a look at this one:

========

Issue: When launching the Configuration Manager Console you may receive the error "MMC Cannot Initialize the Snap-in".

You may also notice that when launching MMC manually (Start -> Run -> MMC) and trying to add/remove the snap-in, the System Center Configuration Manager snap-in doesn't even show up in the list.

Lastly, when looking at the ConfigMgrSetup.log on the root of the C:\ drive of the machine where ConfigMgr Console was installed you may see the following entries in the log:

<date time> Registering C:\Program Files\Microsoft Configuration Manager Console\AdminUI\bin\AdminUI.ResourceExplorerConsole.dll
<date time> Cannot InstallUtil C:\Program Files\Microsoft Configuration Manager Console\AdminUI\bin\AdminUI.ResourceExplorerConsole.dll, error code -1
<date time> Registering C:\Program Files\Microsoft Configuration Manager Console\AdminUI\bin\AdminUI.WqlQueryEngine.dll
<date time> Cannot InstallUtil C:\Program Files\Microsoft Configuration Manager Console\AdminUI\bin\AdminUI.WqlQueryEngine.dll, error code -1
<date time> Registering C:\Program Files\Microsoft Configuration Manager Console\AdminUI\bin\AdminUI.Console.dll
<date time> Cannot InstallUtil C:\Program Files\Microsoft Configuration Manager Console\AdminUI\bin\AdminUI.Console.dll, error code -1

These are all indications of a failed install of the Configuration Manager Console.

Troubleshooting: To get more details on the failure, run the .Net framework InstallUtil.exe program to try and install one of the above mentioned DLL files as follows:

C:\windows\Microsoft.Net\Framework\v2.0.50727\installutil.exe "Drive:\Program Files\Microsoft Configuration Manager Console\AdminUI\bin\AdminUI.ResourceExplorerConsole.dll" /logfile=C:\inst.log showcallstack

where Drive:\ is the drive letter for your Configuration Manager Console install drive letter. The path to the InstallUtil.exe will vary depending on the version of .Net framework installed on the machine where the admin console was installed. The example above is for .Net Framework 2.0 SP1

The command above created a log file C:\inst.log which showed the following information:

Begin Log Excerpt:
Running a transacted installation.

Beginning the Install phase of the installation.
See the contents of the log file for the C:\Program Files\Microsoft Configuration Manager Console\AdminUI\bin\AdminUI.ResourceExplorerConsole.dll assembly's progress.
The file is located at C:\Program Files\Microsoft Configuration Manager Console\AdminUI\bin\AdminUI.ResourceExplorerConsole.InstallLog.

An exception occurred during the Install phase.
System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.Int32.Parse(String s, IFormatProvider provider)
at System.Diagnostics.PerformanceCounterLib.GetStringTable(Boolean isHelp)
at System.Diagnostics.PerformanceCounterLib.get_NameTable()
at System.Diagnostics.PerformanceCounterLib.get_CategoryTable()
at System.Diagnostics.PerformanceCounterLib.CounterExists(String category, String counter, Boolean& categoryExists)
at System.Diagnostics.PerformanceCounterLib.CounterExists(String machine, String category, String counter)
at System.Diagnostics.PerformanceCounter.Initialize()
at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, String instanceName, Boolean readOnly)
at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName)
at Microsoft.ConfigurationManagement.AdminConsole.SmsSnapInInstaller.CounterExists(String counterName)
at Microsoft.ConfigurationManagement.AdminConsole.SmsSnapInInstaller.BuildCounterInstaller(Boolean forUninstallOperation)
at Microsoft.ConfigurationManagement.AdminConsole.SmsSnapInInstaller.Install(IDictionary stateSaver)
at System.Configuration.Install.Installer.Install(IDictionary stateSaver)
at System.Configuration.Install.AssemblyInstaller.Install(IDictionary savedState)
at System.Configuration.Install.Installer.Install(IDictionary stateSaver)
at System.Configuration.Install.TransactedInstaller.Install(IDictionary savedState)

The Rollback phase of the installation is beginning.
See the contents of the log file for the C:\Program Files\Microsoft Configuration Manager Console\AdminUI\bin\AdminUI.ResourceExplorerConsole.dll assembly's progress.
The file is located at C:\Program Files\Microsoft Configuration Manager Console\AdminUI\bin\AdminUI.ResourceExplorerConsole.InstallLog.

The Rollback phase completed successfully.
End Log Excerpt.

Cause: The information above tells us that the cause of our issue is a problem with the performance counters on this machine.

Resolution: To resolve this issue rebuild the performance counters on the machine.  Rebuilding the performance counters should allow the Configuration Manager Admin Console to properly install and open.

Please make a backup of the registry on the Windows machine before rebuilding the performance counters.

For Windows Server 2003, you can use the following command to rebuild all Performance counters including extensible and third party counters, type the following commands at a command prompt. Press ENTER after each command:

1. cd \windows\system32
2. lodctr /R

NOTE: /R is uppercase.

NOTE: If you are running a Cluster or Datacenter product, you must fail over the node to refresh the counter list after doing the preceding steps for both base counters and extensible counters.

NOTE: Running this command, does not rebuild the extensible performance counters added by third party software/servers.

NOTE: On systems that are running applications that add their own performance counters, such as Microsoft Exchange or SQL Server, the .ini file that is used to load the performance counter may not be located in %Systemroot%\System32. These .ini files can usually be found under the applications folder structure.

Windows Server 2003 rebuilds all the counters because it reads all the .ini files in the C:\Windows\inf\009 folder for the English operating system.

For more information on rebuilding the performance counters see the following Knowledge Base article:

300956 How to manually rebuild Performance Counter Library values - https://support.microsoft.com/?id=300956.

For Windows XP machines, the LODCTR /R switch does not work the same as Windows Server 2003, however the performance counters can be rebuilt manually per the above article, or you can also attempt to restore the most recent backup of the PerfStringBackup.ini by running the following command:

lodctr /r:PerfStringBackup.ini

NOTE: Running this command, does not rebuild the extensible performance counters added by third party software/servers.

NOTE: On systems that are running applications that add their own performance counters, such as Microsoft Exchange or SQL Server, the .ini file that is used to load the performance counter may not be located in %Systemroot%\System32. These .ini files can usually be found under the applications folder structure.

After you have completed this procedure, you must re-add the extensible counters from the list of services. Before you do so, however, you must identify the .ini file that is used to load the counters:

1. Open a command prompt window.

2. At the command prompt, type cd %Systemroot%\System32, and then press ENTER.    

3. At the command prompt, type findstr drivername *.ini, and then press ENTER.

4. Note the name of the .ini file for each drivername in the list.    

5. At the command prompt, type the following line, and then press ENTER:  lodctr inifile where inifile is the name of the .ini file for the driver that you want to reload.  

For example, if you want to reload the ASP driver, the list that you noted in step 4 shows that Axperf.ini is the .ini file for the ASP driver (axperf.ini:drivername=ASP). Therefore, to reload the ASP driver, type lodctr axperf.ini at the command prompt, and then press ENTER.    

6.    Repeat step 5 for each .ini file in the list.   

7. Restart the computer.

After rebuilding performance counters on the machine, reinstall the Configuration Manager Console.  At this point it should successfully install and open.

========

Thanks Clifton!

J.C. Hornbeck | Manageability Knowledge Engineer