Blue Prism Product

last person joined: 3 hours ago 

Chat about Blue Prism products
Expand all | Collapse all

Login Agent incorrectly shows machine is not locked

Jump to Best Answer
  • 1.  Login Agent incorrectly shows machine is not locked

    Posted 01-21-2021 10:29
    Is there any reason why Blue Prism would be incorrectly determining the lock state of a machine? I'm running v6.10 on a Windows 10 VM, and it's not always detecting if the machine is locked or not. It does correctly determine if it is logged in or not, but the "Is Locked" in the Login Agent object keeps coming back as false when it is in fact locked. I'm using TeamViewer to connect to the VM. RDP is not in use, and "query user" in command prompt shows I am on the Console session.

    The problem with it not correctly determining the lock state is that, in order to unlock, I need to send an SAS. But if I send an SAS and it's not actually on the lock screen, it brings up the Ctrl+Alt+Del screen which I cannot seem to programmatically close.

    If I run this on my own computer (also Windows 10) - which does not have any of the group policies set - it does correctly determine that my computer is locked.

    Is there something I'm missing that would cause Blue Prism to think the VM is not locked when it is in fact locked?

    ------------------------------
    Nicholas Zejdlik
    RPA Developer
    ------------------------------


  • 2.  RE: Login Agent incorrectly shows machine is not locked
    Best Answer

    Posted 01-21-2021 17:52
    After doing some digging, I found that OpenInputDesktop, which is the function that the Login Agent code uses to determine if the screen is locked or not, was coming back that there is active desktop while Windows was sitting on the lock screen. I also noted that a screenshot taken via Graphics.CopyFromScreen likewise returned successfully while on the lock screen (as opposed to throwing an invalid handle exception, which is usually what happens). The desktop would go inactive briefly while locking and also while typing the password in to unlock, but would remain active while the lock screen was up and no input was being made.

    The issue seems to be related to the version of Windows. Unbeknownst to me, this particular VM had Windows 10 Pro installed instead of Enterprise. It seems that in Enterprise, the desktop is inactive when the screen is locked, whereas on Pro, the desktop is still active even on the lock screen (perhaps this is due to a configuration somewhere).

    What ultimately resolved this was changing the code that the Login Agent object uses to determine if the screen is locked. I came across a StackOverflow post with exactly the issue I was running into that pointed me in the right direction. I replaced the Is Locked code in the Login Agent object to check if the logonui process is running instead of using OpenInputDesktop: Locked = System.Diagnostics.Process.GetProcessesByName("logonui").Length > 0.

    This seems to be working like a charm so far. It seems the only "official" way to determine if the lock screen is active or not would be to create a service and subscribe to the SystemEvents.SessionSwitch events. As far as I can tell, there is no Windows function to determine directly if the screen is locked or not, which seems unfortunate. Anyway, I hope this helps if someone gets caught in a similar situation.

    ------------------------------
    Nicholas Zejdlik
    RPA Developer
    ------------------------------



  • 3.  RE: Login Agent incorrectly shows machine is not locked

    Posted 01-21-2021 23:42
    Hi Nicolás!

    Thanks for sharing the problem and the solution with the community so the problem originates from the difference in the session locked of the window 10 Pro and Enterprise versions and is fixed by setting a line of code in the Login Object.

    best regards

    ------------------------------
    Jhogel Ponne
    Senior RPA
    Ernst & Young
    America/Panama
    ------------------------------



FAQ

Blue Prism is intelligent automation — business-developed, no-code automation that pushes the boundaries of robotic process automation (RPA) to deliver value across any business process in a connected enterprise.

A combination of RPA with expanded cognitive and AI capabilities, Blue Prism is different than other automation technology on the market. With one Blue Prism license, you gain instant access to an already AI equipped digital workforce, along with the tools you need to build and delegate automations. Click here for more information on Blue Prism and Intelligent Automation.
To learn more about how Blue Prism can help your organization and how much it will cost to get started, please Contact our Sales department.
Blue Prism can be downloaded from our customer portal. If you would like to consume or download any material it is necessary to create an account on the Portal. Once you have registered, you can access the download options for Blue Prism here.
Yes! Installed on your own machine and supported by our training materials and product documentation, you can use all the features of the full enterprise product for free with our Blue Prism Trial – giving you the opportunity to learn the basics before moving to a full production implementation. Click here for more information and to download the trial.
Yes! You can access our known issue list for Blue Prism from our Support Portal.
Regardless of your industry, Blue Prism’s Digital Workforce can adhere to strict governance and compliance standards without limiting productivity. Click here for more information on how your industry can benefit from Blue Prism.



Share this post