Jump to content
ilikecl

Help updating script to work in a Locked Remote Desktop

Recommended Posts

Hi All,

So my initial issue with being unable to automate a login was solved, but it turns out it doesn't work with my server when Remote Desktop is locked, thus failing when running from the Task Scheduler. DOH!

I've taken a look at the FAQ and tried to update my script to use the suggested ControlSend() etc. commands, but it doesn't seem to work. As I am not a developer, I suspect my syntax is wrong or I am missing some steps.

Any help/pointers would be appreciated!

Code that works when Remote Desktop is active (Using Send() because it seems there is form field validation that prevents me from using _IEFormElementSetValue()):

Func SignIn();function to login to the Simplisafe website
    Global $oIE = _IECreate("https://webapp.simplisafe.com/#/login"); login page
    Sleep(5000)
    WinActivate("SimpliSafe Control Panel - Internet Explorer")
    Sleep(5000)
    Local $username = _IEGetObjByName ($oIE, "email");sets the variable to the input name on the page (F12, DOM)
    Local $password = _IEGetObjByName ($oIE, "password");sets the variable to the input name on the page (F12, DOM)
    _IEAction ($username, "focus")
    Sleep(2000)
    Send("EMAIL")
    Sleep(2000)
    _IEAction ($password, "focus")
    Sleep(2000)
    Send("PASSWORD")
    Sleep(2000)
    Local $cButtons = _IETagNameGetCollection ($oIE, "button")
        For $oButton in $cButtons
            If $oButton.innerText = "log in" Then
                _IEAction ($oButton, "click")
                _IELoadWait ($oIE)
                ExitLoop
            EndIf
        Next
EndFunc

 

Share this post


Link to post
Share on other sites

You can't use send.   Use something like _ieformsettext (from memory,  it will be similar).  Locked stations and session 0 has no active windows.  Send only can go to active windows.

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites
1 hour ago, jdelaney said:

Use something like _ieformsettext (from memory,  it will be similar)

Do you mean _IEFormElementSetValue? (https://www.autoitscript.com/autoit3/docs/libfunctions/_IEFormElementSetValue.htm)

I've tried that previously, and it used to work on the site, but it seems in their last update they've updated to AngularJS, as far as I can tell, and they've added form field validations that prevent _IEFormElementSetValue from working. 😥

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...