Kaseya Community

Script to run once upon user logon.

  • Hi All,
    I need to find the correct method to use a script that will run once when a user logs onto a PC, the thing I am stuck on is I can only find a process in the script creation /deployment that will run ono a per machine basis.
    I guess I am looking for the equivalent of a one-time logon script. *this is only to disable Hibernation on the users PC. But I cannot seem to deploy it as more than one user logs onto the same PC so this needs to be set at a profile level?
    Can anyone help with this?
    Thanks
    Craig
    MrBungle50

    Legacy Forum Name: Script to run once upon user logon.,
    Legacy Posted By Username: Mrbungle50
  • This may have been covered once before here. But if you'd like to do it the really hard way...



    The registry setting is here

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Power




    Key: Heuristics

    the 7th (seventh) value in that mess should be

    01 for enabled

    and

    00 for disabled.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: thirteentwenty
  • Thanks a lot, will this be able to be automated to run once for each user as they logon?

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Mrbungle50
  • This could be pretty complicated to do.

    After giving this some thought, I think your best bet would be to have the script run every so often and have it checks for some sort of registry entry that was created by the script if had run on the user alread. If the reg entry is there there it knows the script has already run on the user and it reschedules to run again later and you would have to continually do this. If the reg entry is not there then it finishes running the script and reschedules still. This is kind of crude but I'm unable to think of another way to do this with Kaseya.

    You would want to put the reg entry somewhere in HKEY_CURRENT_USER because it would be unique to each user.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: jasonb
  • Mrbungle50
    Thanks a lot, will this be able to be automated to run once for each user as they logon?


    My previous post would affect the "global" settings of the computer so you wouldnt need to do it for each user that logs in. This sounds like the way to go as it sounds like you want to run this on every user that logs in.

    If you absolutly want to script it go jasonbs' route... it shouldnt be too complicated... but I could see it getting out of hand real quick.

    If you want an easy out set a GP logon script to do this for you.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: thirteentwenty