我有一个使用COM对象的Python程序,我想远程运行它。该程序在本地计算机上运行良好,但当我在远程计算机上运行该程序并尝试使用DCOM对象远程连接到远程计算机上的COM对象时,NTLM身份验证失败(在Wireshark捕获中可以看到)。在
这台机器在一个Windows域上,但是我可以在两台机器上创建任意数量的本地用户。我已经尝试在两台计算机上创建相同的本地用户,但是DCOM对象将计算机作为域传递(即尝试使用Machine1\user
对Machine2
进行身份验证)。在
有什么建议吗?在
有没有办法使用pythoncom
或win32com
指定用于NTLM身份验证的不同用户和密码?
我非常愿意回答任何问题,尽可能多地补充细节。在
代码:
print "\nConnecting to '%s'" % LAHostNameOrIP ;
try:
LAConnect = win32com.client.Dispatch("AgtLA.Connect")
# Fails on the LAConnect.GetInstrument call
LAInst = LAConnect.GetInstrument(LAHostNameOrIP)
except pythoncom.com_error, (hr, msg, exc, arg):
print "The AgtLA call failed with code: %d: %s" % (hr, msg)
if exc is None:
print "There is no extended error information"
else:
wcode, source, text, helpFile, helpId, scode = exc
print "The source of the error is", source
print "The error message is", text
print "More info can be found in %s (id=%d)" % (helpFile, helpId)
sys.exit(1)
目前没有回答
相关问题 更多 >
编程相关推荐