Launching script from GPO problem

This topic contains 7 replies, has 2 voices, and was last updated by  Simon B 4 weeks ago.

  • Author
    Posts
  • #80222

    Scott Windmiller
    Participant

    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

  • #80227

    Simon B
    Participant
  • #80234

    Scott Windmiller
    Participant

    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.

  • #80245

    Simon B
    Participant

    ok another possible way 🙂 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

  • #80255

    Scott Windmiller
    Participant

    Yeah, that would be my last resort as I didnt want to have to maintain 2 scripts for one reason 🙂
    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

  • #80257

    Simon B
    Participant

    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

  • #80270

    Scott Windmiller
    Participant

    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.

  • #80272

    Simon B
    Participant

    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(

You must be logged in to reply to this topic.