【问题标题】:Start-DscConfiguration cannot connect the server machineStart-DscConfiguration 无法连接服务器机器
【发布时间】:2015-01-23 22:21:42
【问题描述】:

我正在尝试针对远程计算机运行我的 DSC 配置并最终出现以下错误

VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' =
SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' =
root/Microsoft/Windows/DesiredStateConfiguration'.
The WinRM client cannot process the request. If the authentication scheme is different from Kerberos, or if the client
computer is not joined to a domain, then HTTPS transport must be used or the destination machine must be added to the
TrustedHosts configuration setting. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts
list might not be authenticated. You can get more information about that by running the following command: winrm help
config.
    + CategoryInfo          : NotEnabled: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : HRESULT 0x803380e4
    + PSComputerName        : vishtest.timmons.com

VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 0.169 seconds

服务器正在运行 WinRM 服务并配置为通过 HTTPS 运行。客户端机器可以通过 Enter-PSSession 命令成功连接到远程机器。

Enter-PSSession -computerName vishtest.timmons.com -credential $credential -UseSSL

关于我在这里可能缺少什么的任何想法?

【问题讨论】:

  • 编辑您的问题并包含您正在运行的实际Start-DscConfiguration 命令。另外,您是否在目标机器上安装了DSC-Service 功能?
  • 抱歉错过了,这里是 Start-DscConfiguration -machineName [myservername] -wait -verbose 我不知道 Dsc-Service,只是检查了一下,看起来像用于 DSC 拉动配置。我不认为我在做推或拉配置,至少现在还没有。我正在尝试在我的机器上运行配置以手动更新服务器。希望这有助于清除一些事情。
  • 您的意思是-ComputerName 而不是-machineName-Path 是必需参数,并且缺少。您实际上是在尝试进行推送配置。你也做不到。 Dsc-Service 功能在将应用配置的任何节点上都是必需的,而不仅仅是用于设置 Pull 服务器。
  • 是的,@briantist。我确实弄错了。没有在工作计算机前响应的后果。对于那个很抱歉。但我确实找到了答案并发布了它。我不需要在目标计算机上安装或启动 Dsc-Service 来将配置推送到它。感谢您的帮助。

标签: powershell dsc


【解决方案1】:

在一些推特的帮助下才弄明白。我必须使用 -UseSSL 标志创建一个 CimSession 并将该会话传递给 Start-DscConfiguration 命令。 Start-DscConfiguration 本身没有 -UseSSL 选项。不需要目标上的任何 DSC 服务来推送配置。

【讨论】:

  • 供将来参考:$option = New-CimSessionOption -SkipCNCheck -UseSsl > $session = New-CimSession -ComputerName $env:COMPUTERNAME -SessionOption $option > Start-DscConfiguration -Path "MyPath" -CimSession $session -Wait -Verbose > Remove-CimSession $session
【解决方案2】:

尝试运行此命令:

启用-PSRemoting -Force

当我遇到该错误时,这总是对我有用!

【讨论】:

    猜你喜欢
    • 2018-10-12
    • 2019-10-08
    • 2015-10-29
    • 1970-01-01
    • 2012-07-27
    • 2020-11-03
    • 2023-04-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多