微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

WinRM 无法处理请求 - 由策略服务器控制

如何解决WinRM 无法处理请求 - 由策略服务器控制

我有一个脚本可以为 ansible 控制节点启用基本身份验证以连接到 Windows 主机。下面是脚本,当我执行脚本时,我收到一个错误 msg The config setting Basic cannot be changed because is controlled by policies.

Set-Service WinRM -StartMode Automatic
Set-Item -Force WSMan:\localhost\Service\Auth\Basic $True
winrm set winrm/config/service/auth '@{Basic="true"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'

当我执行脚本时,我收到以下错误消息

Set-Item : The config setting Basic cannot be changed because is controlled by policies. The policy would need to be
set to "Not Configured" in order to change the config setting.
At C:\Users\krishna_venkata\Desktop\test.ps1:2 char:1
+ Set-Item -Force WSMan:\localhost\Service\Auth\Basic $True
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Set-Item],InvalidOperationException
    + FullyQualifiedErrorId : system.invalidOperationException,Microsoft.PowerShell.Commands.Setitemcommand

WSManFault
    Message
        ProviderFault
            WSManFault
                Message = The config setting Basic cannot be changed because is controlled by policies. The policy would need to be set to "Not Configured" in order to change the config setting.

Error number:  -2144108406 0x8033808A
Cannot change GPO controlled setting.
WSManFault
    Message
        ProviderFault
            WSManFault
                Message = The config setting AllowUnencrypted cannot be changed because is controlled by policies. The policy would need to be set to "Not Configured" in order to change the config setting.

Error number:  -2144108406 0x8033808A
Cannot change GPO controlled setting.

这是当前的 winrm 配置

Service
    RootSDDL = O:NSG:BAD:P(A;;GA;;;BA)(A;;GR;;;IU)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD)
    MaxConcurrentOperations = 4294967295
    MaxConcurrentOperationsPerUser = 1500
    EnumerationTimeoutms = 240000
    MaxConnections = 300
    MaxPacketRetrievalTimeSeconds = 120
    AllowUnencrypted = false [Source="GPO"]
    Auth
        Basic = false [Source="GPO"]
        Kerberos = true
        Negotiate = true
        Certificate = false
        Credssp = false
        CbtHardeningLevel = Relaxed
    DefaultPorts
        HTTP = 5985
        HTTPS = 5986
    IPv4Filter = *
    IPv6Filter = *
    EnableCompatibilityHttpListener = false
    EnableCompatibilityHttpsListener = false
    CertificateThumbprint
    AllowRemoteAccess = true

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。