2 Replies Latest reply on Feb 11, 2019 8:42 AM by andrewgresbach

    Run script delayed after login?

    andrewgresbach Apprentice

      In our environment we are using a cloud based printing solution for our field staff.  When the user logs in, that cloud application loads and after it logs them in it then maps the printer that is assigned to their account.  Before that, their specific printer is not present under Devices & Printers.   The time that it gets created can vary depending on how fast/slow other startup applications load.

       

      I have a powershell script that looks for their printer and sets it as default and having a problem w/ a good way of when to run it.  If it runs too soon it obviously wont work since the printer object that its looking for doesn't exist yet.    So far I have tried running a custom node when the "userinit.exe" process ends since i thought that might wait the longest of the logon process.....it sometimes works but half the time not (i've watched task manager and Devices & Printers and when it does work its REALLY close timing so i'm not surprised that it isn't consistent.  

       

      I am curious to anyone elses ideas of how/when to run this......is there any way to set it to run like I have it but either set a slight 1 min delay or even can i somehow set it to run and repeat every minute for say 5 min just to make sure it catches?

       

      any help would be appreciated!  thank you