【问题标题】:Set winrm/config/service RootSDDL via powershell通过 powershell 设置 winrm/config/service RootSDDL
【发布时间】:2020-01-07 18:56:41
【问题描述】:

我需要通过 powershell 以编程方式为 winrm/config/service 设置 RootSDDL

PS C:\Windows\system32> winrm set winrm/config/service @{RootSDDL="O:NSG:BAD:P(A;;GA;;;BA)(A;;GA;;;RM)(A;;GR;;;IU)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD)"}
Error: Invalid use of command line. Type "winrm -?" for help.
PS C:\Windows\system32>

winrm get winrm/config/service

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 = true [Source="GPO"]
    Auth
        Basic = true [Source="GPO"]
        Kerberos = true
        Negotiate = true
        Certificate = false
        CredSSP = false
        CbtHardeningLevel = Relaxed
    DefaultPorts
        HTTP = 5985
        HTTPS = 5986
    IPv4Filter = * [Source="GPO"]
    IPv6Filter = * [Source="GPO"]
    EnableCompatibilityHttpListener = true [Source="GPO"]
    EnableCompatibilityHttpsListener = true [Source="GPO"]
    CertificateThumbprint
    AllowRemoteAccess = true [Source="GPO"]

资源

https://docs.ansible.com/ansible/latest/user_guide/windows_winrm.html#non-administrator-accounts https://www.sevecek.com/Lists/Posts/Post.aspx?ID=280

【问题讨论】:

    标签: powershell winrm


    【解决方案1】:

    您可以使用Set-PSSessionConfiguration cmdlet 设置一些选项: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/set-pssessionconfiguration?view=powershell-6

    或者,如果您对 winrm/config/service 设置感兴趣,您可以通过 WSMan 提供程序浏览它们:cd wsmna:\localhost\service 并使用 *-item cmdlet(Get-ItemSet-Item 等)。 如果您想在cd wsmna:\localhost\ 中查看其他 WSMan 详细信息。

    在 powershell 中,您可以创建自定义端点来连接和限制可用的 PowerShell 语言和 cmdlet。更多详情:https://docs.microsoft.com/en-us/powershell/scripting/learn/remoting/jea/overview?view=powershell-6

    希望一切顺利! 最好的祝福, 伊万

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-05-02
      • 2014-01-16
      • 2021-12-02
      • 2020-12-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多