我试图用python脚本从一台windows机器(这台机器安装了python26)远程到另一台windows机器(这台机器没有安装python)。我通过谷歌搜索发现WMI模块非常好。所以我试着用这个。以下是我的代码:class WindowsMachine:
def __init__(self, ip, username, password, remote_path=REMOTE_PATH):
self.ip = ip
self.username = username
self.password = password
self.remote_path = remote_path
try:
print "Establishing connection to %s" %self.ip
self.connection = wmi.WMI(self.ip, user=self.username, password=self.password)
print "Connection established"
except wmi.x_wmi:
print "Could not connect to machine"
raise
但我收到错误消息:wmi.x\u访问被拒绝。我在谷歌上搜索到了解决这个问题的方法,但没有得到一个合适的答案。有人能帮忙吗?以前有人遇到过这个吗?在