Programmatically check if the VRay license is valid

We have had some instances where someone from our team didn’t set up their VRay license correctly, or there was some issue with the installation, or they didn’t log, or something like that. Digging through the logs or even opening the menu is enough to figure out what happened (that there’s no license active in the machine) and thus caused the script or rendering to fail, but is there any way at all to find out programmatically if there’s a valid license in the system?

Worst case scenario, I could parse the logs, but if there’s a way through code or even some CLI way to do that (like a return code from an executable), that would be ideal for me.

you could check the existence and connectability of the license server from maxscript like so:
internet.CheckConnection url:@"https://localhost:30304" force:true​
but beyond that, that i could tell, you’re left with querying the licensing server log.

​​​​​​​I’ll try and find out if there’s anything more specific i have missed and come back to you.

I have asked, and there is one method: you can run vray.exe with an empty vrscene (literally an empty textfile named empty.vrscene will do).
Should a license not be found, it will return an error.

Two things are worth noting:
*) the process, from command start to failure, took about 3 seconds on my machine (where i had turned off the -reachable- license server), but it could be more for a hung connection.
*) It took 135 megabytes of RAM to load the exe and libraries.

If i had to choose in liberty, i’d be parsing license server logs.​