cancel
Showing results for 
Search instead for 
Did you mean: 

Login Agents in VDI environments

SteveWaters
Staff
Staff
Folks;

I am looking at how customers and partners are using Login Agent with VDi systems and would like to get an idea as to scalability and the operational level of effort.

Thanks,

------------------------------
Steve Waters
Platform Consultant
Blue Prism Professional Services
America/Chicago
------------------------------
1 BEST ANSWER

Best Answers

For those that are interested, the following function can be used to replace the existing GetLoggedInUsers() function within the Global Code section of the Login Agent VBO. This will return all users regardless of whether they're logged in via the console or an RDP session.

FWIW - This is VB.Net, but there's no code high-lighting option for VB on this platform.
Public Function GetLoggedInUsers() As ICollection(Of String)
    Dim users As New List(Of String)
    Dim moReturn As Management.ManagementObjectCollection
    Dim moSearch As Management.ManagementObjectSearcher
    Dim mo As Management.ManagementObject
    
    ' Retrieve a list of "explorer.exe" processes running on the system. Each logged in
    ' user session will have exactly one "explorer.exe" session.
    moSearch = New Management.ManagementObjectSearcher("Select * from Win32_Process Where name='explorer.exe'")
    moReturn = moSearch.Get

    ' Cycle through the returned process instances and get the owner of each.
    For Each mo In moReturn
        Dim arOwner(2) As String
        mo.InvokeMethod("GetOwner", arOwner)
        users.Add(arOwner(1) & "\" & arOwner(0))
    Next
    
    Return users
End Function​


Cheers,



------------------------------
Eric Wilson
Director, Partner Integrations for Digital Exchange
Blue Prism
------------------------------

View answer in original post

16 REPLIES 16

MayankGoyal2
Level 8
@Steve WatersIn our case one strange issue we face is with login agent get logged in users. When we login to any blue prism VM via remote desktop and run login agent is logged in / get logged in users action, it returns no user login. When we check the task manager, it shows multiple users logged in a machine. I checked the function get logged in users code in global code of VBO and its referring to localhost, I am sure that function needs some kind of fix to make it work with VM setup.

------------------------------
Mayank Goyal
------------------------------

Manank;

Thank you for responding.  I presume you have automate running via a batch file that launches when someone logs in.  That would account for that I believe. I'm trying to understand why you are logging in using RDP?  

VDI's are designed for people.  It tends to make RPA a bit more complex. What type of VDI are you using?


------------------------------
Steve Waters
Platform Consultant
Blue Prism Professional Services
America/Chicago
------------------------------

@Steve Waters - The VM are persistent VM as mentioned in link - https://bpdocs.blueprism.com/bp-6-8/en-us/deploy-to-virtual-environment-nhs.htm?Highlight=deploying%20blue%20prism%20to%20a%20virtual having windows server OS. Whenever we have to get into any VM and access blue prism, we use remote desktop for the same. I am not sure of an alternative to RDP and will that make any difference.

------------------------------
Mayank Goyal
------------------------------

I guess my first question is why are you accessing the Runtime Resources on a regular basis?  Operationally I recommend something like pcAnywhere, VNC, or VMware Console to access the VM.  The point is to access at a console level vs. RDP which adds some complexity.  The purpose of the Login Agent is to minimize the need to access a RR VM directly.  The VM should be executing at the console level. 

I also recommend rebooting the VM after you've accessed it with RDP to make sure all of the sessions are closed.  This can impact certain automations

The exception being environments configured to use RDS to create VM's.  In that case they are using a designed form of access that accounts for each RDP session on a different port. 

Would you be willing to email me your Login Agent configuration file?   That will help me figure out what's going on.  Send it private of course. 

Regards, 




------------------------------
Steve Waters
Platform Consultant
Blue Prism Professional Services
America/Chicago
------------------------------

@Steve Waters - Thanks a lot for your response, so shall I put it this way for my better understanding.
E1 and E2 machines - where we develop and test the process, it is fine to access these via RDP because we work on BP studio and wont be using login agent on E1 and E2.

When running process on E3 via login agent, avoid RDP on that machine. The login process of login agent will do a console based login on machine and then run the main process and there won't be issues. If anytime accessed via RDP, reboot to ensure all session are closed and login agent functions properly.

My last question is if we want to run a process in E3 under observation for some time by dragging it in control room before we put it on scheduler and login agent, for that we can still do RDP as we are not utilizing login agent?



------------------------------
Mayank Goyal
------------------------------

@Mayank Goyal  My pleasure sir. 

The only the Login Agent does is allow connectivity to a Runtime Resource that is not logged in.  That's why it runs as a service.

In most cases Runtime Resources are configured to launch the Runtime Resource script (Automate.exe) via the Task Scheduler at login,  so it would make sense if you had multiple RDP sessions you would have multiple Runtimes as well.  

There are tools like VNC that would let you monitor a process on a Runtime without logging into it. 

As a rule it is best practice to separate Development and Production environments.  Note that BP licenses only apply to Production Processes. 

Cheers

------------------------------
Steve Waters
Platform Consultant
Blue Prism Professional Services
America/Chicago
------------------------------

Mayank, ​Were you ever able to find a fix for the login agent stating "no user logged in"? I'm facing a similar issue when I run the "Check logged in action". Likewise I'm able to log out/lock the VDI, however I am unable to l back in when calling the process. Set up is a VDI on Windows 10, and I'm using RDP to access it.

------------------------------
Aaran Fraser-Hitchen
Software Developer
QinetiQ
------------------------------

@Aaran Fraser-Hitchen - This is what i understood so far - The login agent action get logged in users is for checking console based logged in user on machine. When you login to a VM with RDP, that is a terminal session login which is different from console login. If you logout of the VM and your VM shows logged out in control room, then if you run the login process and once login is successful and machine shows logged in in control room, then run is logged in on that machine, will show as True as its a console based login. ​ Please let me know if it works for you.

------------------------------
Mayank Goyal
------------------------------

I believe this is an issue with the design of the GetLoggedInUsers() function of Login Agent. The function uses a WMI query to collect user info, but it queries the Win32_ComputerSystem node which does not support reporting info about RDP connections.

i think we might have a solution that queries against Win32_Process instead and gets the owner of every "explorer.exe" instance. It should be tested today. If it works out I'll post the updated function definition here.

Cheers,

------------------------------
Eric Wilson
Director, Partner Integrations for Digital Exchange
Blue Prism
------------------------------