2

Ok, guys, here is the scenario:

1)We have every night 3 scheduled scripts running, those are Python scripts that use autogui functions, so we must have an active session. We run an rdp, say, to machine X (which runs the codes) inside rdp to machine Y (this was a solution we found so that the autogui will get machine Y's gui and peripherals when the session is disconnected).

2) Our IT dept. is unsupportive and will not change the group policy that blocks the user session after 15 minutes.

3) We devised a simple script that sends keystrokes every 3 minutes (scroll lock specifically). We run this in both machines X and Y, on a powershell session kept open in both machines. The script is shown below.

$Shell = New-Object -ComObject Wscript.Shell
Start-Sleep -Seconds 1

Do {
$Shell.SendKeys("{SCROLLLOCK}")
$Shell.SendKeys("{SCROLLLOCK}")

Start-Sleep -Seconds 180
}
While($True)

THE PROBLEM: The script seem to work fine for most of the time, then some days it would not. It will work for 1 or 2 days in a row then fail the next one. By fail I mean I open the rdp session in the morning and my session is locked up, meaning all the nightly scripts failed and we'd have to spend half of the day running everything, all the company's reports, delayed.

This is becoming increasingly frustrating and we have a lot of pressure to make this work, to keep the session active overnight without IT involvement because they would not change their policy.

THE QUESTION: if the script below seem to work fine at least during the day, and sometimes for days in a row, what other actions/processes would cause my session to be disconnected? Another policy we must circumvent by other means? Another user's actions?

3
  • 1
    "we'd have to spend half of the day running everything, all the company's reports, delayed." ... "Our IT dept. is unsupportive" -- this is a people problem, not a software problem. Escalate this to someone that can give IT a kicking. Commented May 22, 2019 at 11:11
  • I wish this was possible... unfortunately we have no power over this issue, so right now I'm just wanting to understand if our script can fail and why, and/or determine what other actions, policies or events can trigger a screen lockout, so we have some 'ammunition' to tell IT our specific problem. Without that they won't even move.
    – SieluLintu
    Commented May 22, 2019 at 11:35
  • 1
    "we have no power over this issue" -- there exists someone in the organization hierarchy who does have power. Escalate it to them. If this is truly delaying all of the company's reports, they should care. Anyhow, this part is potentially a question for workplace.SE Commented May 22, 2019 at 12:57

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.