Group Policy run Script based off Event ID


Disclaimer: I'm still quite new to Group Policy, so if you need any more information or have an alternate way to do this please let me know!

In Windows 10 I'm trying to run a PowerShell script whenever Event 10000 shows up in Event Viewer under Applications/Microsoft/Windows/NetworkProfile, which is just when a new network connection is established.

Right now I have a scheduled task that is triggered by Event 10000 and has the following settings:

  • Program/script C:\Users\username\Desktop\disable_juniper.ps1
  • Stop if the computer ceases to be idle No
  • Restart if the idle state resumes No
  • Start the task only if the computer is on AC power No
  • Stop if the computer switches to battery power No
  • Allow task to be run on demand Yes

For now the PowerShell file is just located on the desktop of the logged in user (which is just me on a test machine right now).

After verifying the group policy was being applied correctly to my test machine I tried connecting to a few networks, but the script never runs. In addition, the scheduled task is being run under my account (administrator), and is being run with the highest privileges. The script itself works fine when I run it on the machine, I just can't get it to apply through group policy.

Any ideas for why this may not be working would be much appreciated!

EDIT: Looking through event viewer I found the following:

Event 4098

The computer '' preference item in the 'disable_juniper {B3462C08-9DBF-4081-83BD-6A03CF3886E9}' Group Policy Object did not apply because it failed with error code '0x80070005 Access is denied.' This error was suppressed.

asked on Stack Overflow Apr 1, 2020 by Alexander Saad • edited Apr 1, 2020 by Alexander Saad

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0