Universal port scripts are called profiles and are executed based on several types of trigger events, including device detection and undetection and user authentication and unauthentication.
For information on how to create profiles and configure the triggers, see Universal Port.