Overview
In order to write Microsoft Configuration Manager (ConfigMgr) SDK code it is necessary to use some of the .NET assemblies that are supplied with the SCCM console. The assemblies are located in C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin. For basic operations the following assemblies are usually required:
- Microsoft.ConfigurationManagement.ManagementProvider.dll
- AdminUI.WqlQueryEngine.dll
Other assemblies are required for more complicated ConfigMgr functions, for example those that work with the Application model and Rights-based Access Control (RBAC) categories:
- Microsoft.ConfigurationManager.CommonBase.dll
- Microsoft.ConfigurationManagement.ZipArchive.dll
- DcmObjectModel.dll
- AdminUI.DcmObjectWrapper.dll
- AdminUI.RbacCategory.dll
- Microsoft.ConfigurationManagement.ZipArchive.dll
- AdminUI.AppManFoundation.dll
- Microsoft.ConfigurationManagement.ApplicationManagement.*
Configuring Visual Studio to use ConfigMgr Assemblies
The most basic way write programs that use the ConfigMgr assemblies is:
- Copy the required DLLs into your Visual Studio project folder
- Add the DLLs as References
- Set the references to be copied to your output folder on compile (the ConfigMgr are in the same folder as your resulting executable)
- Distribute your program and the reference assemblies
ConfigMgr Assembly Redistribution
Bundling your program executable with the ConfigMgr assemblies is a perfectly acceptable solution when you are writing a company internal-use application. However, if you intend to publish the application on the internet then a major problem is that it is not permitted to redistribute the ConfigMgr assemblies. When distributing your program outside of your company you must only include your program executable and remove the ConfigMgr SDK assemblies and then:
- Ask the end user to find an ConfigMgr console and manually copy the the required DLL files
- Configure an installer or script that will look for a locally installed ConfigMgr console and automatically copy the DLLs files
Neither of these methods are very user friendly. My preferred solution is to require that the end-user has a locally installed copy of the ConfigMgr console and then configure the executable to automatically load the required assemblies on demand. For details of this method see: Using AssemblyResolve to Load ConfigMgr SDK Assemblies On Demand.