简体   繁体   English

从Linux OMI(omicli)到Windows WMI的连接失败,并显示与DMTF相关的错误

[英]Connection from Linux OMI (omicli) to Windows WMI fails with DMTF related error

I am implementing OMI client on CentOs in C++ to communicate with windows WMI I have installed OMI on Linux CentOS 7 and trying to connect to Windows 7 using the sample utility provided by OMI. 我正在C ++中的CentO上实现OMI客户端以与Windows WMI通信我已经在Linux CentOS 7上安装了OMI,并尝试使用OMI提供的示例实用程序连接到Windows 7。

Reference: https://github.com/Microsoft/omi 参考: https : //github.com/Microsoft/omi

Also configured WINRM on Windows to receive basic authentication calls. 在Windows上还将WINRM配置为接收基本身份验证调用。

I am not able to get the sample working. 我无法使示例工作。 Getting the following error: 出现以下错误:

root@LinuxMachine bin]# ./omicli --auth Basic --hostname WinMachine.TEST.COM -u admin -p adminpassaword ei root/cimv2 Win32_Environment --port 5985
./omicli: result: MI_RESULT_FAILED
./omicli: result: ERROR_INTERNAL_ERROR: The WS-Management service cannot process the request. A DMTF resource URI was used to access a non-DMTF class. Try again using a non-DMTF resource URI.

Below is the WINRM configuration for the destination machine for reference 以下是目标计算机的WINRM配置,以供参考

C:\\Windows\\system32>winrm get winrm/config C:\\ Windows \\ system32> winrm获取winrm / config

Config
    MaxEnvelopeSizekb = 150
    MaxTimeoutms = 60000
    MaxBatchItems = 32000
    MaxProviderRequests = 4294967295
    Client
        NetworkDelayms = 5000
        URLPrefix = wsman
        AllowUnencrypted = true [Source="GPO"]
        Auth
            Basic = true [Source="GPO"]
            Digest = true [Source="GPO"]
            Kerberos = true [Source="GPO"]
            Negotiate = true [Source="GPO"]
            Certificate = true
            CredSSP = true [Source="GPO"]
        DefaultPorts
            HTTP = 5985
            HTTPS = 5986
        TrustedHosts
    Service
        RootSDDL = O:NSG:BAD:P(A;;AG;;;BA)S:P(AU;FA;GA;;;WD)(AU;SA;GWGX;;;WD)
        MaxConcurrentOperations = 4294967295
        MaxConcurrentOperationsPerUser = 15
        EnumerationTimeoutms = 60000
        MaxConnections = 25
        MaxPacketRetrievalTimeSeconds = 120
        AllowUnencrypted = true
        Auth
            Basic = true [Source="GPO"]
            Kerberos = true [Source="GPO"]
            Negotiate = true [Source="GPO"]
            Certificate = false
            CredSSP = true [Source="GPO"]
            CbtHardeningLevel = Relaxed
        DefaultPorts
            HTTP = 5985
            HTTPS = 5986
        IPv4Filter = *
        IPv6Filter = *
        EnableCompatibilityHttpListener = false
        EnableCompatibilityHttpsListener = false
        CertificateThumbprint
    Winrs
        AllowRemoteShellAccess = true
        IdleTimeout = 180000
        MaxConcurrentUsers = 5
        MaxShellRunTime = 2147483647
        MaxProcessesPerShell = 15
        MaxMemoryPerShellMB = 150
        MaxShellsPerUser = 5

Am I missing anything obvious? 我有什么明显的遗漏吗? Any help with getting the sample working is much appreciated. 我们非常感谢您提供有关样品工作的帮助。

I had encountered similar issue. 我遇到过类似的问题。 I have resolved this by upgrading power-shell version on my server. 我已通过在服务器上升级Power Shell版本解决了此问题。

Windows 7 by-default shows uses powershell version 2.0. Windows 7默认显示使用Powershell 2.0版。

PS C:\> test-wsman <clientName>

wsmid           : http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd
ProtocolVersion : http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd
ProductVendor   : Microsoft Corporation
ProductVersion  : OS: 0.0.0 SP: 0.0 Stack: 2.0

By-default CIM session uses WSMAN protocol, specifically newer version of protocol. 默认情况下,CIM会话使用WSMAN协议,特别是协议的较新版本。 This won't work for computers running powershell version 2.0 or no powershell at all. 对于运行Powershell 2.0版或完全没有Powershell的计算机,这将不起作用。 Upgrade your to resolve this issue. 升级以解决此问题。

Refer URL https://mcpmag.com/articles/2013/05/07/remote-to-second-powershell.aspx for more details. 有关更多详细信息,请参阅URL https://mcpmag.com/articles/2013/05/07/remote-to-second-powershell.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM