I'm trying to execute a Microsoft Exchange command using Powershell under a Python RPyC server. In my MS Windows 2012 Server, works fine, but in 2008 version, doesn't work.
This is part of my code:
...
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))
...
I've checked that in Windows 2008 Server is only possible to execute CMD commands via RPyC, like:
conn.modules.os.popen("dir")
Some tip?