1

我正在尝试更新我的 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。

4

1 回答 1

0

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

  1. 不使用部分配置
  2. 不使用证书加密凭据

在https://connect.microsoft.com/PowerShell/Feedback/Details/1292678上打开了一个关于连接的问题(包含更多详细信息)

于 2015-05-01T18:02:39.300 回答