I'm working on a program that will allow users to connect to one of three accounts on a terminal server. They will be able to choose between an internal connection or an external connection, depending on whether they're working in the office or at home.
Only one user can use an account at any given time, so I'm trying to make it so the program will deny access if a user is already connected - but I am encountering issues.
I'm using the Shell function to run batch files which connect to the terminal server. This is cheap way of doing things, and it doesn't work well: Remote Desktop Connection remembers login attempts to the same server, so sometimes it connects me to the wrong account. I can't choose the connection type through this method either.
I've been looking at ways to detect whether a user is still logged in or not, but I don't know what will work. Something that will read/write a log file on the terminal server would be an option, I don't know how to go about it though.
Is there anything in VB.NET that will allow me to do the above?