There are 2 main versions of MMC available on Windows, MMC 2.0 (Windows 2000 and XP) and MMC 3.0 (Windows Server 2003). I'll mainly explain how to develop a Snap-in with MMC 3.0.
You can upgrade MMC 2.0 to MMC 3.0 using this install supplied by Microsoft
MMC 2.0 snapin:
Download the Platform SDK, Windows® Server 2003 R2 Platform SDK Web Install, from http://www.microsoft.com/downloads/details.aspx?FamilyID=0baf2b35-c656-4969-ace8-e4c0c0716adb&DisplayLang=en
Build an example from the Platform SDK install:
C:\Program Files\Microsoft Platform SDK\Samples\SysMgmt\MMC\mmc2.0\simple>nmake
MMC 3.0 snapin:
MMC Snap-ins for MMC 3.0 can be developed with the Windows SDK, for information on the snapin classes see msdn Management Console
There is also an opensource .NET library at http://sourceforge.net/projects/mmclibrary
The MMC 3.0 application installation is at http://www.microsoft.com/downloads/details.aspx?FamilyID=61fc1c66-06f2-463c-82a2-cf20902ffae0&DisplayLang=en
Here's an example of how to build a simple SnapinTo develop MMC 3.0 snapins you'll need the microsoft.managementconsole.dll library. This library can be gotten by installing the MMC 3.0, found at http://www.microsoft.com/downloads/details.aspx?FamilyID=61fc1c66-06f2-463c-82a2-cf20902ffae0&DisplayLang=en
Add this library as a reference to your Snapin project and you'll have access to it's functionality. .
You can also install the Windows Server 2003 R2 Service pack. Some example code is available on the web.
public override void Install(IDictionary stateSaver);
public override void Rollback(IDictionary savedState);
public override void Uninstall(IDictionary savedState);
MMC 3.0 - A managed code 'task manager' MMC 3.0 snap-in
The procedure to install the MMC Snapin in MMC 2.0 and MMC 3.0 is different, see below for further details:
MMC 2.0 snapin:
Register the snapin with MMC:
C:\Program Files\Microsoft Platform SDK\Samples\SysMgmt\MMC\mmc2.0\simple\WIN2000_DEBUG>regsvr32 Simple.dll
This snapin was build with MMC 3.0 as ManagementConsoleSnapin.dll
The resultant DLL, C:\MySnapinProject\bin\Debug\ManagementConsoleSnapin.dll, can be installed as a snapin to MMC 3.0 as follows: >C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\installutil.exe C:\MySnapinProject\bin\Debug\ManagementConsoleSnapin.dll
and uninstalled using:
>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\installutil.exe /u C:\MySnapinProject\bin\Debug\ManagementConsoleSnapin.dll
After installation the snapin appears in the MMC Snapin list as "My Management Console". Add the snapin to MMC and select OK. The Snapin is now ready for use.
MMC Snapin Debugging
The easiest way to debug the MMC while installing the Snapin is to set the Project Properties of your snapin project, in the project properties Debug tab select 'Start External Program' and enter 'C:\WINDOWS\system32\mmc.exe' in the field. Now when you hit F5 the MMC app will launch, you now 'Add\Remove Snapin' from the MMC's File menu.