Launching script from GPO problem

I made a GUI that launches a Network Policy when the user logs in, this is done though GPO Logon Script. After the user “Accepts” the policy we have it minimize to the tray and when clicked on, it gives them info about their computer that we may ask them for so we want this script/gui to always be running.
The problem is this seems to leave the GPO “open” or running and will not update other policies at the next update interval.
Is there anyway I can have the GPO launch this script then let go of the GPO per say?

Thanks,
Scott

Not sure if this is of any help

https://social.technet.microsoft.com/Forums/windowsserver/en-US/0a8997dc-5219-4a43-a8b9-959a718bb88f/how-does-a-powershell-script-execute-from-the-startup-folder-in-the-gpo-and-not-from-the-local-file?forum=winserverGP

Thanks for the reply. This is the way I have it setup and it does launch just fine and minimizes to the tray. The problem is that while its running (which we want to be all the time) the GPO never completes and never runs subsequent GPO checks.

ok another possible way :slight_smile: use gpo to copy a batch file and your ps1 script to the users startup folder. the .bat file will then launch your ps1 script on startup

Yeah, that would be my last resort as I didnt want to have to maintain 2 scripts for one reason :slight_smile:
I also thought I could make a “launcher” script that would run from GPO and the launcher script would call the actual script. Not sure if that work or not and also has the same downfall as the above but may be my only choice. Was hoping someone else may have an another idea.

Thanks for your help!
Scott

you could try converting your ps1 to an exe then you would only have one script to maintain

https://gallery.technet.microsoft.com/scriptcenter/PS2EXE-Convert-PowerShell-9e4e07f1

Yeah, thats a good idea. I wrote it in Powershell Studio and can create the exe from there but saved it as a PS1 to make it easier in the GPO. Now I wonder if I would have the same problem if it was an exe. Thanks, I will have to try that out.

Let me know how you get on. I think it should work as when launching a ps script it is waiting for a return (unless you run it as-job). Launching an exe it should not be waiting for a return same as launching a .bat file(