You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't use pypsrp to connect Exchange Server by thes codes:
from pypsrp.powershell import PowerShell, RunspacePool
from pypsrp.wsman import WSMan
def get_mailbox_info():
host = "win-at34242t.dc.com"
username = username
password = password
# 创建 WSMan 对象
wsman = WSMan(
server = host,
username="dc\\test",
password="123456Test!",
path= "PowerShell",
ssl=False,
port=80,
cert_validation=False
)
# 创建 RunspacePool 对象
pool = RunspacePool(wsman, configuration_name="Microsoft.Exchange")
# 创建 PowerShell 对象
ps = PowerShell(pool)
print("创建Powershell对象成功!")
try:
ps.add_cmdlet("Get-Mailbox").add_parameter("")
output = ps.invoke()
print("[+] OUTPUT:\n%s" % "\n".join([str(s) for s in output]))
except Exception as e:
print(f"wrong:{e}")
finally:
pool.close()
get_mailbox_info()
terminal return :Received a WSManFault message. (No details returned by the server)
The text was updated successfully, but these errors were encountered:
I can't use pypsrp to connect Exchange Server by thes codes:
from pypsrp.powershell import PowerShell, RunspacePool
from pypsrp.wsman import WSMan
def get_mailbox_info():
host = "win-at34242t.dc.com"
username = username
password = password
get_mailbox_info()
terminal return :Received a WSManFault message. (No details returned by the server)
The text was updated successfully, but these errors were encountered: