Appendix C: Creating Group Policy Objects to Assign Logon Scripts in Microsoft Windows
Some of the procedures in the Secure Browser subsection of the Windows section of the Operating System Configuration chapter refer to creating a group policy object that contains instructions for Windows to execute upon certain events. The procedure in this appendix explains how to create a group policy object that runs a script when a user logs on. The script itself is saved in a file called logon.bat.
-
In the taskbar (Windows 10 or Windows 11), or in Start ➔ Run (previous versions of Windows), enter gpedit.msc and then select the link. The Local Group Policy Editor window, shown in figure 1, appears.
Figure 1. The Local Group Policy Editor window
- Expand Local Computer Policy ➔ User Configuration ➔ Windows Settings ➔ Scripts (Logon/Logoff) (indicated in figure 1).
- Select [Logon] and then double-click. The Logon Properties dialog box appears.
-
Select [Add…] (indicated in figure 2). The Add a Script dialog box appears.
Figure 2. The Logon Properties dialog box
-
Select [Browse…] (indicated in figure 3) and navigate to the logon.bat to be run.
Figure 3. The Add a Script dialog box
- Select [OK] (also indicated in figure 3) to return to the Logon Properties dialog box.
- Select [OK] to return to the Local Group Policy Editor.
- Close the Local Group Policy Editor.