For automation purposes, I need to know the foreground window process running on a remote machine.
I've written small scripts (C#
, Python
, Powershell
) to do this - each of these scripts is using some or the other form of GetForegroundWindow()
These scripts work perfect if I run them on manually the machine.
But when I use PSExec to run these scripts from a remote machine, all of these return process name = Idle
What could have gone wrong?