We need to configure the screen lock timeout on our laptop machines so that the inactivity time dynamically changes according to the connection: if the laptop is directly connected to the corporate network through Ethernet, then the screen should lock after 15mn, but in any other circumstances (laptop either not connected to any network, or connected but through VPN) this time should be reduced (let's say, down to 5 minutes)...
All client machines run on Windows 7 or 10 Enterprise.
Please note that this has to be independent of the power options, and that the screen lock timeout could change several times during a single user session. For example, a user removes his/her laptop from its docking station (screen lock timeout gets changed from 15mm to 5mn), then later on shuts it down, boots it while disconnected from the network (still 5mn screen lock timeout), works a while through VPN (still 5mn), then puts it back on the docking station and the laptop reconnects to the corporate network through Ethernet (screen lock timeout back to 15m)...
GPO's administrative templates don't allow for configuring the screen lock based on the network connection. Any ideas of the best ways to implement this?
So far, I was thinking about using event-triggered scheduled tasks. But I do not know what events could be used to accurately link such task triggers...