以编程方式操纵活动的RDP会话 [英] Programmatically manipulating active RDP session

查看:118
本文介绍了以编程方式操纵活动的RDP会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在运行Mac OSX,并且想以编程方式操纵一个活动的RDP会话,例如,在该会话内的已启动程序中执行操作(特别是动态性,但知道通用方法不会受到伤害).

I've got Mac OSX running and want to programmatically manipulate a active RDP session to for instance, perform actions within a launched program within the session (dynamics specifically, yet woudn't hurt to know a universal way).

我不知道这是否可行.当前使用RDP文件通过凭据启动RDP会话,并具有通过NSWorkspace检索的我的活动会话的进程ID.这样,我可以做一些基本的事情,例如再次关闭会话,但我想操纵该会话.

I don't know if this is possible. Currently using a RDP file to launch the RDP session with credentials and have the process ID of my active session, retrieved via NSWorkspace. With that I can do the basic stuff like closing my session again, yet i want to manipulate the session.

我的RDP客户端当前是Microsoft远程桌面.

My RDP client currently is Microsoft Remote Desktop.

希望通过bash或python达到我的目标.

Would wish to reach my goal in either bash or python.

推荐答案

以下是一些建议:

  • Use Quartz graphics library in Python to manipulate with RDP client window. Here is a good start: How to list all windows from all workspaces in Python on Mac?
  • Use libfreerdp via ctypes.
  • Run RDP session under Wine and use tools such as AutoHotKey, AutoIT or xdottool. See: How to programmatically control X11 forwarded apps?
  • Use WinRM (pywinrm) instead of RDP to run remote commands/scripts. Check this example. This can allow to run auto tools mentioned above (e.g. AHK script controlling the apps).
  • Use Python GUI automation library for simulating user interaction in apps.
  • See also: GUI scipting for Linux.
  • Write an RDP client that dumps the pixels of the screen. E.g. WebRTC or using libFreeRDP.
  • If RDP client runs via X11 protocol (Quartz), you can try to tap into X11 requests as per this post.
  • Use FreeRDP and its API. Its client is compatible with Linux, macOS and Windows.

这篇关于以编程方式操纵活动的RDP会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆