在通过 MSDN 上的 SCCM 2012 SDK 文档工作后,我目前陷入尝试安装应用程序管理扩展的困境:
http://msdn.microsoft.com/en-us/library/hh949507
文档说明我应该调用 DeploymentTypeExtender.Extend:
using DCM = Microsoft.ConfigurationManagement.AdminConsole.DesiredConfigurationManagement;
[...]
ConnectionManagerBase connectionManager = new WqlConnectionManager();
connectionManager.Connect("SiteServerName");
DeploymentTypeExtender.Extend(@"C:\RdpTechnology.cmdtx", new DCM.ConsoleDcmConnection(connectionManager, null), @"\\SiteServerName\root\sms\site_ABC");
但是,当我拨打电话时,我得到的只是一个例外:
Unhandled Exception: Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine.WqlQueryException: The SMS Provider reported an error. ---> System.Management.ManagementException: Generic failure
at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
at System.Management.ManagementObject.Put(PutOptions options)
at System.Management.ManagementObject.Put()
at Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine.WqlResultObject.Put(ReportProgress progressReport)
--- End of inner exception stack trace ---
at Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine.WqlResultObject.Put(ReportProgress progressReport)
at Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine.WqlResultObject.Put()
at Microsoft.ConfigurationManagement.AdminConsole.DesiredConfigurationManagement.ConsoleDcmConnection.Microsoft.ConfigurationManagement.DesiredConfigurationManagement.IDcmStoreConnection.StoreNewItem(ConfigurationItem item)
at Microsoft.ConfigurationManagement.ApplicationManagement.DeploymentTypeExtender.CreateTechnologyBasedConfigurationItem(ZipPackagePart zipPackagePart, IDcmStoreConnection connection)
at Microsoft.ConfigurationManagement.ApplicationManagement.DeploymentTypeExtender.PostDeploymentTypeExtension(String deploymentTypeExtensionFilePath, IDcmStoreConnection connection, String wmiLocation, Boolean comprehensive, Boolean revision)
at Microsoft.ConfigurationManagement.ApplicationManagement.DeploymentTypeExtender.Extend(String deploymentTypeExtensionFilePath, IDcmStoreConnection connection, String wmiLocation)
at RdpTechnology.Build.DeploymentTypeExtenderUtil.Extend(String deploymentTypeExtensionFilePath) in C:\Users\goakley\Documents\SCCM Deployment Type\AppMan\Build\DeploymentTypeExtenderUtil.cs:line 38
at RdpTechnology.Build.Program.Main(String[] args) in C:\Users\goakley\Documents\SCCM Deployment Type\AppMan\Build\Program.cs:line 22
更多信息显示在 DebugView 中:
[1520] SmsAdminUISnapIn Error: 1 :
[1520] System.Management.ManagementException\r\nGeneric failure \r\n at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
[1520] at System.Management.ManagementObject.Put(PutOptions options)
[1520] at System.Management.ManagementObject.Put()
[1520] at Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine.WqlResultObject.Put(ReportProgress progressReport)\r\nManagementException details:
[1520] instance of SMS_ExtendedStatus
[1520] {
[1520] Description = "The digest is not valid";
[1520] ErrorCode = 1078462235;
[1520] File = "e:\\nts_sccm_release\\sms\\siteserver\\sdk_provider\\smsprov\\sspconfigurationitem.cpp";
[1520] Line = 2142;
[1520] Operation = "PutInstance";
[1520] ParameterInfo = "";
[1520] ProviderName = "ExtnProv";
[1520] StatusCode = 2147749889;
[1520] };
[1520] \r\n
这表明我在尝试安装的应用程序管理扩展中捆绑的 XML 文件之一已损坏 - 但它都是直接从 MSDN 复制和粘贴的。