RealVNC

I have used RealVNC in our organization for many years and the other day I was kind of bored and decided to make an app that would tell me which PC’s had it installed and was it listening for the viewer.

My situation is this: User calls or sends in support request, I open up a log file looking for the users IP or machine name, enter it in the vnc viewer and try to connect. I wanted a faster, easier way to do this with less steps.

For this I would read in the log files for the user logons, then test each PC the user was last logged onto to see if it had vnc listening on port 5900. Easy enough.

For those interested first you will need to setup a logon script, here is mine:

I have this script along with the logoff script in the DC NETLOGON share.

In Group Policy I use the User Configuration\Policies\Windows Settings\Scripts\Logon and logoff settings to specify my script location. Now each time the user logs off and on it makes an entry in their corresponding log.

Here is the logoff script, its the same except “logon” is replaced with “logoff”:

So that gives me the file I need for the next step which is loading the list with the following:

This function calls GetUsers to load the list of users that we currently have log files for and then if we are checking for a vnc connection call TestSelectedPort and set the image for the list view item appropriately.

Here is the project zipped for you with all the code.

Remote Project

Once the application is run you are first presented with a static list of the users PC’s. Depending on what view you choose it will either be a picture of a pc with machine name of if you choose details then you will see a list showing the user, pc name, last logon and the ip.

I blocked out the username for security reasons, but you get the idea.

If we click the Check VNC button this is what you end with showing which PC’s are up and running VNC.

Go ahead and download the file and give it a try.

Leave a Reply