Kaseya Community

Log on script? Run once?

This question is answered

HI!

Is there a way to  write a run once script that will fire when anyone logs in ?

I want to deploy this script to 300 users.

Example:

Write a file to directory.

Write a run once command (Reg) so the .exe will run after someone logs in.

Then shut down the PC.

This will write the file, shut down the workstation, and then run the .exe  after any user has logged in.

Any help on this?

Thanks for your help!

B

Verified Answer
  • Hi GM.

    I have figured it out and thought I would share.

    The procedure I have written will do this:

    Write a file to the Windows directory,  Write a registry entry in the run once hkey local machine ,  Shut down the machine.  That way when any user logs on - the file will run, and only run once.  I have just used this for a migration with OPH as the file.  Forces the user to input the email address and password before the desktop is available, then continues to load their desktop and configures outlook for them and imports their mail.  This works for xp32-64 and  win7 - 32 and 64.  I just deployed this technique to 200 users to set their new outlook profile and import their accounts.

    Could be used with any other exe, msi, or app.

    I deployed this at 1 am and this was available when any employee came in and turned their workstation on.  I wouldn't suggest using this during work hours as you might shut down a user in the middle of something without the chance to save their work.

    Here is the info:

    Run Once

    Always true

    Set registry path HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\(Name Folder) of datatype REG_SZ to value C:\(Location of file)

    Write file (LOCATION OF FILE) to C:\(Name Folder)\(FILE NAME)

    Execute procedure IT Automation.IT Center.2 Desktop Tools and Utility Procedures.Windows Shutdown delayed by Immediate

    The "Name Folder" and "Location of file" are your variables.  The file name is the name of the file, app, or msi with extension.

    Thanks again for everyone's input!

    Brad Willard

All Replies
  • The machines involved are xp and 7 - 32 and 64 - on and off domain.  

  • HI Richard,

    Can you please expand a little bit on what you want to achieve?

    Also am I right in saying when someone logs on you want a file to run and then have the machine shut down? This doesn't sound like something users would like.

    If it were me I would do this in a logon script or write a batch file and put a link into the all users startup folder to run the batch file minimized. I wouldn't rely on Kaseya to pickup every time a user logs on and off as you may find it to be hit and miss.

    On and off a domain is not a problem. If they have Kaseya agents you can write a simple procedure that will write the batch file and shortcut file for the startup folder.

  • Hi GM.

    I have figured it out and thought I would share.

    The procedure I have written will do this:

    Write a file to the Windows directory,  Write a registry entry in the run once hkey local machine ,  Shut down the machine.  That way when any user logs on - the file will run, and only run once.  I have just used this for a migration with OPH as the file.  Forces the user to input the email address and password before the desktop is available, then continues to load their desktop and configures outlook for them and imports their mail.  This works for xp32-64 and  win7 - 32 and 64.  I just deployed this technique to 200 users to set their new outlook profile and import their accounts.

    Could be used with any other exe, msi, or app.

    I deployed this at 1 am and this was available when any employee came in and turned their workstation on.  I wouldn't suggest using this during work hours as you might shut down a user in the middle of something without the chance to save their work.

    Here is the info:

    Run Once

    Always true

    Set registry path HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\(Name Folder) of datatype REG_SZ to value C:\(Location of file)

    Write file (LOCATION OF FILE) to C:\(Name Folder)\(FILE NAME)

    Execute procedure IT Automation.IT Center.2 Desktop Tools and Utility Procedures.Windows Shutdown delayed by Immediate

    The "Name Folder" and "Location of file" are your variables.  The file name is the name of the file, app, or msi with extension.

    Thanks again for everyone's input!

    Brad Willard

  • Glad it worked out. Thanks for letting us know, Brad.

  • If all you wanted to do is pre-configure an Outlook profile for new accounts the normal way of doing this is to use a PRF file.

    What I personally do is store the PRF file in a network share and make the login script (either GPO or netlogon) check if the PRF file is located under the user profile using the IF NOT EXIST command; If it is not in the user profile then it copies it from the network share to the user profile and runs the Outlook import PRF command to configure the users' Outlook Profile.

    The reason I do it this way is because its completely automated for all domain accounts and it can be deployed via GPO which is better for configuring User Profiles, recreating the Outlook user profile is as simple as removing the PRF file from the user profile folder and getting them to logoff and login again.