WIN11 GPO logon/logoff script doesn't trigger (but works with double click?)

med 1 Reputation point


On Win10 everything works smoothly but on WIN11 my skripts doesn't work anymore.

I've installed GPO on WIN11 Home Edition.
GPO: Userconfiguration- windows - scripts - startup/Logon: (both folders i tried)
The script contains

"C:\Program Files\wol.exe" 00-xx-xx-xx-xx-xx

I've tried "scripts" and "powershell-skripts".

When I'm putting the file into: "C:\Users\xxxx\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"

it works... also with double click... but not in the GPO?
I've tried also a short skript with an echo message, but nothing will triggerd. When I'm shutting down neither by logoff..

I also have an script for shutdown... same thing

Has anyone an idee what I can try now?

Thanks for you help

A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
4,053 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Limitless Technology 38,766 Reputation points

    Hi @med

    Please check if $env:PSModulePath contains C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules.

    If not, add them to the system variable "PSModulePath" in Environment Variables in the System Properties window.

    Also, it could be PowerShell's default security level, which (IIRC) will only run signed scripts.

    Try typing this:

    Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process

    That will tell PowerShell to allow local (that is, on a local drive) unsigned scripts to run. Then try executing your script again.

    I hope this answers your question.


    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments

  2. med 1 Reputation point

    Thanks for you reply... unfortunately, theenviroment variables were set

    and the change of the execution policy didn't changed anything :(

    Very strange... I also tried a powershell script (because you can set in the gpo setting both)... when I'm double click the file it works fine... but on start up nothing

    thanks for you help
    i appreciate it

    0 comments No comments

  3. Tinus van Gils 1 Reputation point

    Did you found a solution for it? I have the same problem :(

    0 comments No comments