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

med 1 Reputation point
2022-03-31T06:30:23.957+00:00

Hey.

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

Windows
Windows
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
    2022-04-06T10:55:33.783+00:00

    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.

    Thanks.

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

    0 comments No comments

  2. med 1 Reputation point
    2022-04-08T05:08:05.427+00:00

    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
    2022-11-22T13:38:46.233+00:00

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

    0 comments No comments