能够使用powershell 5为LCM设置CertificateID

能够使用powershell 5为LCM设置CertificateID,powershell,dsc,powershell-5.0,Powershell,Dsc,Powershell 5.0,我正在尝试更新我的DSC部署,以便现在使用部分配置来分解配置。为此,我现在需要使用拉过程而不是推过程 当我尝试应用LCM的配置时,它看起来像: [DscLocalConfigurationManager()] Configuration CreateGESService { param( [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [PsCredential] $InstallCredential,

我正在尝试更新我的DSC部署,以便现在使用部分配置来分解配置。为此,我现在需要使用拉过程而不是推过程

当我尝试应用LCM的配置时,它看起来像:

[DscLocalConfigurationManager()]
Configuration CreateGESService
{
param(
    [Parameter(Mandatory=$true)] 
    [ValidateNotNullorEmpty()] 
    [PsCredential] $InstallCredential,
    [Parameter(Mandatory=$true)] 
    [ValidateNotNullorEmpty()] 
    [PsCredential] $RunCredential
)

Node $AllNodes.NodeName
{

    $hostVersion = (get-host).Version
    # changed how the possible values for debugMode in the February build
    if (($hostVersion.Major -ge 5) -and ($hostVersion.Minor -ge 0) -and ($hostVersion.Build -ge 9842)){
        $debugMode = 'All'
    }
    else{
        $debugMode = $true
    }
    #setup the localConfigManager
    Settings 
    {
         #CertificateID = $node.Thumbprint
         # slower performance - and only available WMF5
         # now we need to kill the dsc
         DebugMode = $debugMode
         ConfigurationMode = 'ApplyAndAutoCorrect'
         ConfigurationModeFrequencyMins = '15'
         AllowModuleOverwrite = $true
         RefreshMode = 'Push'
         ConfigurationID = $node.ConfigurationID
    }

    PartialConfiguration GetEventStoreConfiguration {
        Description = "Contains the stuff for GetEventStore Being Installed"
        ConfigurationSource = "[ConfigurationRepositoryShare]ConfigSource"
        RefreshMode = "Pull"
    }

    PartialConfiguration ExternalIntegrationConfiguration{
        Description = "Contains the stuff for External Integration"
        ConfigurationSource = "[ConfigurationRepositoryShare]ConfigSource"
        DependsOn = '[PartialConfiguration]GetEventStoreConfiguration'
        RefreshMode = "Pull"
    }

    PartialConfiguration ServeGroupSpike{
        Description = "Contains the stuff for External Integration"
        ConfigurationSource = "[ConfigurationRepositoryShare]ConfigSource"
        DependsOn = '[PartialConfiguration]ExternalIntegrationConfiguration'
        RefreshMode = "Pull"
    }

    ConfigurationRepositoryShare ConfigSource{
        SourcePath = "\\someServer\Shared\dscService\Configuration"
        Credential = $InstallCredential
    }

    ResourceRepositoryShare ResourceSource{
        SourcePath = "\\someServer\Shared\dscService\Resources"
        Credential = $InstallCredential
    }
}
如果我尝试包含CertificateID,则会出现如下错误:

The property CertificateID of metaconfiguration is not compatible with the current version 2.0.0 of the configuration
document. This property only works with version greater than or equal to 1.0.0 . In case the version is greater, then
the property MinimumCompatibleVersion should be set to atleast 1.0.0 . Set these properties in the
OMI_ConfigurationDocument instance in the document and try again.
    + CategoryInfo          : InvalidArgument: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : MI RESULT 4
    + PSComputerName        : SGSpike-Main
当然,当尝试应用配置时,它无法解密传递的凭据,并且我在事件视图中得到一个错误,如:

Job {B37D5239-EDBA-11E4-80C2-00155D9ACA1F} : 
WarningMessage An error occured while applying the partial configuration [PartialConfiguration]ExternalIntegrationConfiguration. The error message is : 
The Local Configuration Manager is not configured with a certificate. Resource '[File]GpgProgram' in configuration 'ExternalIntegrationConfiguration' cannot be processed..

有什么办法吗?当我在推送模式中使用单一配置时,我使用了certificateID。

即使在2015年4月的放弃中,问题似乎仍然存在。进一步诊断表明,您可以:

  • 不使用部分配置
  • 不使用证书加密凭据
  • 在的connect上打开了一个问题(提供了更多详细信息)