Use sp_logintrigger to set a global login trigger that is executed at each user login. To take user-specific actions, use sp_modifylogin or sp_addlogin to set a user-specific login trigger.
You can activate sp_logintrigger by setting trace flag -T4073.
See the Reference Manual: Procedures.