能够使用2月PowerShell 5为LCM设置CertificateID

时间:2015-04-28 16:48:52

标签: powershell dsc powershell-v5.0

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

当我尝试将LCM的配置应用于:

[title~=container] {
    width: 100% !important;
}

如果我尝试包含CertificateID,我会收到如下错误:

[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
    }
}

当然,当尝试应用配置时,它无法解密传递的凭据,并且我在事件视图中收到错误,如:

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

任何想法如何做到这一点?当我在推送模型中使用单个配置时,我使用了certificateID。

1 个答案:

答案 0 :(得分:0)

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

  1. 不使用部分配置
  2. 不使用证书加密凭据
  3. https://connect.microsoft.com/PowerShell/Feedback/Details/1292678

    上打开关于连接的问题(有更多详情)