Hi @ftiff,
The easiest way to do this would be using a Limitation of a network segment in your scope.
If you haven't already, define a few network segments in Settings > Network Organization > Network Segments. Then, in the scope tab of your profile, set the Targets to the intended devices (All Devices or All Student Devices), and under Limitations, limit the scope to a specific network segment.
What will happen is when devices are on your network, the profile will be installed, but once they connect to a different network, the profile will be removed.
Hope that helps!
-Kitzy