Friday, March 1, 2024
HomeWINDOWSGPO Startup Script is not running

GPO Startup Script is not running [Troublehoot]

-


If the GPO Startup Script is not running, then this post may help. A Group Policy Object (GPO) Startup Script refers to a script or batch file configured to run automatically when a computer boots into the operating system. But recently, some users have complained that the GPO Startup Script is not running. Fortunately, you can follow some simple suggestions to fix the error.

GPO Startup Script is not running [Troublehoot]

Fix GPO Startup Script is not running

Follow these steps to fix GPO Startup Script is not running error in Windows devices:

  1. Check Group Policy Settings
  2. Change Script Execution Policy Using Powershell
  3. Modify your PowerShell Script
  4. Reset, Refresh and Apply Group Policy settings

Now let’s see these in detail.

1] Check Group Policy Settings

Misconfigured settings in the Group Policy Editor can also be why the GPO startup script is not running. Make sure that all the settings are configured correctly. Here’s how:

Press Windows + R to open Run, type gpedit.msc and hit Enter.

Navigate to the following path:

Computer Configuration> Windows Settings > Scripts (Startup/Shutdown).

Double-click on Startup in the right pane and click on Show Files.

Scripts Startup Shutdown

Lastly, click on the Browse button, double-click on your script to choose it, and click OK to save the changes.

Again, navigate to the following path:

Computer Configuration > Administrative Templates > Windows components > Windows Powershell

In the right pane, double-click on Turn on Script Execution and click on the Enabled button.

Turn on Script Execution

Next, select Allow all scripts under Execution Policy.

Click on Ok to save the changes, restart your PC and see if the error’s fixed.

2] Change Script Execution Policy Using Powershell

Next, try changing the script execution policy using Powershell. The execution policy in PowerShell determines what kind of scripts can be run on a system. Here’s how:

Click on Start, search PowerShell and select Run as Administrator.

Type the following command and hit Enter:

Set-ExecutionPolicy Unrestricted

4] Modify your PowerShell Script

Next, add this command to the beginning of your Powershell script. This will pop up a box and let you know if the script is running correctly or not running at all. Here’s the command:

$wshell = New-Object -ComObject Wscript.Shell 
$clk = $wshell.Popup("Hello World",0,"Here I Am",0x1)

5] Reset, Refresh and Apply Group Policy settings

Lastly, reset, refresh and then apply the Group Policy Settings. Follow these steps to do so:

Click on Start, search Command Prompt and click on Run as administrator.

Type the following commands and hit Enter:

RD /S /Q 
"%WinDir%\System32\GroupPolicyUsers" && RD 
/S /Q 
"%WinDir%\System32\GroupPolicy"gpupdate /force

Restart your PC and see if the startup script is not running error gets fixed.

Read: Which GPO ADMX to use for a Windows Mixed Environment and how?

How do I know if my GPO startup script is running?

To check if the GPO startup script is running, run the gpresult command with the /H switch and search for startup.vbs and logoff.vbs in the INI Path. This’ll offer visibility into the execution of GPO startup scripts.

How do I add a startup script to GPO?

For adding a script in GPO, right-click on the Startup Script, select Properties and click on the Add script. Next, click the Browse button and select the script in the Script Name field. The startup script will now appear on the Startup Properties page.

GPO Startup Script is not running [Troublehoot]



Source link

www.thewindowsclub.com

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular