通过Python rpyc在Wndows服务器远程exchange命令中运行
我正在尝试在Python RPyC服务器下使用Powershell执行Microsoft Exchange命令。 在我的MS Windows 2012服务器中,工作正常,但在2008版本中,不工作 这是我代码的一部分:通过Python rpyc在Wndows服务器远程exchange命令中运行,python,powershell,exchange-server,rpyc,Python,Powershell,Exchange Server,Rpyc,我正在尝试在Python RPyC服务器下使用Powershell执行Microsoft Exchange命令。 在我的MS Windows 2012服务器中,工作正常,但在2008版本中,不工作 这是我代码的一部分: ... try: conn = rpyc.classic.connect(server) except: print "[ERROR] Unexpected error:", sys.exc_info()[0] conn.modules.os.popen("pow
...
try:
conn = rpyc.classic.connect(server)
except:
print "[ERROR] Unexpected error:", sys.exc_info()[0]
conn.modules.os.popen("powershell.exe -profile -nointeractive \"& \"Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010; New-organization -name %s -DomainName %s -ProgramId Infoplan01 -OfferId 6 -location en-US -AdministratorPassword %s\"" % (domain, domain, passwd))
...
我已经检查过,在Windows 2008中,服务器只能通过RPyC执行CMD命令,如:
conn.modules.os.popen("dir")
一些提示?我认为您不使用它有一个很好的理由?我正在尝试创建一个python脚本,以便在linux设备中运行。您是否尝试过在桌面会话中直接在2008设备上运行cmd.exe的PS命令?也许你会得到一些有用的错误信息。