SG Security Journal

Run Powershell from a GPO

04 Jun 2024


Getting a Powershell script to run from a group policy object (GPO) should be easy. You should be able create a GPO, go to Computer Configuration > Policies > Windows Settings > Scripts > Startup (or Shutdown) and enter the path to your script on the PowerShell Script tab. For some reason I have found that this doesn’t work every time.

I find the following configuration to be more reliable.

Example Configuration

In your GPO go to Computer Configuration > Policies > Windows Settings > Scripts > Startup (or Shutdown) and select the Scripts tab (not the PowerShell Scripts tab).

Set the Script Name field to be:

%windir%\System32\WindowsPowerShell\v1.0\powershell.exe

Set the Script Parameters field to be:

-Noninteractive -ExecutionPolicy Bypass –Noprofile -file <Path to script in double quotes>


Related Posts:

Large hand controlling puppets

Installing RSAT using Powershell

Not strictly a security topic but I use the the Remote Server Administrator Tools (RSAT) a lot and its one of the first thin...

12 Apr 2024