Hi All,
Just wanted to post about something I crafted to help address a concern for some environments around Screen Sharing, whether using Apple's built in Screen Sharing process, or through Casper Remote.
As outlined in this Feature Request (https://jamfnation.jamfsoftware.com/featureRequest.html?id=167), there is a valid concern over the lack of any notification of a Screen Sharing session starting and then ending. Although its possible to get notified of a Screen Sharing session starting by way of Casper Remote with the user account settings set to always prompt the end users to authorize the connection, there is never any indication of when the session ends. Its not easily possible for a client to know that a remote technician isn't still viewing their screen. While some may just consider it being paranoid, its a bit inarguable that it remains a valid issue. To make matters worse, if someone is using the built in Screen Sharing.app, there is no user authentication presented. You simply remote in and the end user simply doesn't know its happening.
I recall this issue being raised by some techs that I was training during my very first Casper Suite installation some years ago. I didn't have a good answer for them then, and it always bugged me that there wasn't a simple way of knowing if the screen was still being observed.
Some months back I decided to see if there was some way to address this. My research led me to find some posts on the subject of how to monitor ports on OS X and see established connections. In playing around with it, I hacked a simple process together that could tell me if there was an active Screen Sharing session happening, and when it subsequently ended.
Recently, this came up again on the same Feature Request. I dug out the process from earlier in the year and decided to take a fresh look at it to see if I could come up with something that would really work well enough that it could be considered for use in various environments.
I'm finally ready to announce it, and I put together a github page with a release so anyone who wants to use it can download it and try it out.
You can find all the source files as well as a pre-packaged installer pkg here:
https://github.com/mm2270/ScreenSharingMonitor/
How it works
I outlined the process of how this actually works in the Read Me on the Github page, so read that for more information, but the long and short of it is, its using both a LaunchDaemon and a LaunchAgent. The Daemon does the bulk of the work of detecting Screen Sharing sessions (or lack of one) and taking appropriate action. The Agent does the work of notifying the user by calling a compiled version of terminal-notifier. As such, this can be used currently only with 10.8 and higher. If you needed it to work with older version of OS X, the script can be made to work with something else like cocoaDialog, so you'd just need to modify the script accordingly. I settled on terminal-notifier and Notification Center messaging because, frankly, we're not really doing much support on Lion and below at this point, so I didn't feel it was necessary to accommodate those older OS releases.
I've done testing with this in our environment against different OSes ranging from 10.8.5 through 10.10, and it seems to work pretty well and reliably. Its also been tested when Casper Remote screen sharing from JSS 8.73 and 9.61. I don't see any reason it wouldn't work with some older and some newer releases of Casper Suite, but I can't confirm any of that at this time.
YMMV, so I welcome any feedback on it you may have if you decide to try it.
Also, I would welcome any improvements you may make to it, especially if someone can figure out an even more reliable way of knowing when a Screen Sharing session starts or ends.
