Remote Machine Command and ScreenGrab issues

Hi, I am having this problem with executing remote command and I can’t figure out what is wrong, can you suggest ideas please:

I am writing a script that upon HouseCleaning event will send a remote command to all online and non-idle slaves and grab a screengrab and save it to network folder.

I have installed Python27 on slave machine as well as PIL and win32gui just in case. For this test I an simple trying to grab small 100x100 rectangle using img = ImageGrab.grab((0,0,100,100)) command.

Everything works just fine if I log into slave remotely, run command prompt and enter c:\python27\python.exe c:\myscript.py, it works just fine, it grans the image ans saves it to the location I need…

However if I send same command via RemoteControl->ExecuteCommand, it give me an error message saying: IOError: screen grab failed.

What am I doing wrong? The only thing I can think of right now is that it related to permission issues since when I run script manually I apparently logged in as user, but Deadline launches script perhaps with different permissions this is not allowed to grab a screen image?

Are your slaves running as a service? If so, hooks to capture the device id:0 (screen) won’t be available.

Is there a way around it? I was thinking to run python code by windows task scheduling system to execute screen grab let’s say every 5 minutes and then depending on what’s going on on screen either grab a render window I am interested in, or just make blank screen that will display words “idle”, or “offline” etc… The problem with this is that even if slave machine will be trying to execute that python regardless of its status in renderfarm. I wanted something that can get screengrab of render windows “on demand” so to speak.

Apart from not running as a service and being logged into the machine, I’m not aware of a way in Python. It’s Canada Day today, so others might chime in tomorrow if they have any ideas.

Yeah, short of running the service with ‘interact with desktop’ enabled (tends to not work too well with network permissions), there will be absolutely no graphics context to take a snapshot of.