How to Configure Scripts with GPOs in Windows Server - V2 Cloud

Tech Tutorials

How to Configure Scripts with GPOs in Windows Server

  • September 20, 2023
  • Author:

Background Image

How to Configure Scripts with GPOs
in a Windows Server

The Group Policy Object is a feature on Windows Server that empowers administrators to create and implement scripts that allows them and other users connected to the server to perform several tasks during user logon/logoff or computer startup/shutdown.

Due to an increased reliance on automation, this article will discuss the general configuration of scripts using GPO.

Configuring Scripts using GPOs

This general configuration and implementation setup varies based on the Windows Server version and the type of scripts you want to run. Logon/logoff scripts are for users, while startup/shutdown scripts are for computers, and each has a different directory.

It is important to perform the test in a controlled environment so that incorrectly configured scripts will not create issues on client machines. Here’s a general stepwise procedure on configuring scripts using Group Policy Objects and how to implement such scripts on Windows Server:

Step 1: Create the Script

The first thing to do is to create the script you want to run on the Windows Server using PowerShell or any other application such as Notepad. Scripts have different executable formats, with batch files (.bat), Visual Basic script files (.vbs), and PowerShell script (.ps1) being the most common.

Afterward, store the script in an accessible folder on the Windows Server.

Step 2: Create a GPO

  • Navigate to Administrative Tools > Group Policy Management.
  • Create a GPO in the desired domain or organizational unit (OU) (if you have a GPO, you can move to the next step).

Background Image

  • In the Name text box, type the name of the script.
  • Click OK.
  • Right-click on the created GPO,
  • Click Edit.

Background Image

Step 3: Navigate to the Script

  • For logon/logoff scripts, navigate to Group Policy Management Editor window > User Configuration > Policies > Windows Settings > Scripts.
  • For startup/shutdown scripts, navigate to Group Policy Management Editor window > Computer Configuration > Policies > Windows Settings > Scripts.

Step 4: Set the Script Path (Logon Script)

  • Click on Scripts (Logon/Logoff).

Background Image

  • In the details pane, double-click Logon.

Background Image

  • Right-click on the Logon script.

Background Image

  • Click on Browse.
  • Copy the script you created and paste it into the location you were taken to.
  • Close the folder.

Step 5: Add the Script

  • Right-click again on the Logon Script.
  • Click on Add.

Background Image

  • Under Add the Script click on Browse.

Background Image

  • Select the pasted script.
  • Click on OK twice.
  • Close the Group Policy Management Editor window and the Group Policy Management Console.

Step 6: Update the Policy

  • Open the Command Prompt.
  • Run the command gpupdate /force.

Background Image

Try V2 Cloud!

V2 Cloud is a fully integrated Virtual Desktop solution that functions like a Remote Desktop Server but is better as it guarantees optimum file security and user experience/performance. Get started with a risk-free 7-day trial, and experience the power of V2 Cloud.

Back To Tutorials Menu

Back to top

Let us help you find the solution that fits your business needs