Windows server core container+ python + wmi unable to connect to remote system cim class

Langesh Dharmalingam 1 Reputation point
2021-02-26T05:31:50.523+00:00

In "python:2-windowsservercore" python windows container image, python wmi not able to connect to remote server, however same works for localhost

As it gives as "access denied", i have tried access same wmi from other windows server there it works without any issue

I have tried on windows server core OS on a server, even there it works.

Look like issue specify to the windows core os container image, Firewall service not running & no anit-virus block. remote node reachable

Windows core server container running on Host VM OS windows 2019. Firewall disabled in host OS C:>python Python 2.7.18 (v2.7.18:8d21aa21f2, Apr 20 2020, 13:25:05) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. import wmi wmispace = wmi.WMI("x.x.x.x", user="administrator", password="xxxxxx") Traceback (most recent call last): File "", line 1, in File "C:\Python\lib\site-packages\wmi.py", line 1354, in connect handle_com_error() File "C:\Python\lib\site-packages\wmi.py", line 258, in handle_com_error raise klass(com_error=err) wmi.x_access_denied: <x_wmi: Unexpected COM Error (-2147352567, 'Exception occurred.', (0, u'SWbemLocator', u'Access is denied. ', None, 0, -2147024891), None)>

Steps reproduce the issue
installed docker on windows 2019

docker pull python:2-windowsservercore

docker run -dit --network publicNetwork --dns cmd.exe

docker attach

in the container cmd, python

import wmi wmispace = wmi.WMI("x.x.x.x", user="administrator", password="xxxxxx")

you will see the above error and error comes in less than 1 sec

Something is block wmi class access from windows container, but same works good on any windows without any issue

Windows for business Windows Server User experience Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Xiaowei He 9,936 Reputation points
    2021-03-01T08:23:29.177+00:00

    Hi,

    It's sorry to say I'm not familiar with python and not have the environment to test it.

    If you think the issue is related to Windows server core + python +WMI not work, it's recommended to feedback via the following link:

    http://windowsserver.uservoice.com/forums/295047-general-feedback

    Sorry for the limited help.

    Thanks for your time!
    Best Regards,
    Anne

    -----------------------------

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.