Would you like to learn how to use a group policy to distribute a Proxy Auto-configuration file? In this tutorial, we will show you how to create a Proxy Auto-configuration file.

• Windows 2012 R2
• Windows 2016
• Windows 2019
• Windows 10
• Windows 7

Hardware List:

The following section presents the list of equipment used to create this Zabbix tutorial.

Every piece of hardware listed above can be found at Amazon website.

Tutorial Windows – IIS Installation

Install an IIS server to make the Proxy configuration script public available.

Open the Server Manager application.

Access the Manage menu and click on Add roles and features.

Windows 2012 add role

On the Server Roles screen, select the option named: Web Server IIS.

Click on the Next button.

IIS Installation

On the following screen, click on the Add features button.

IIS Features

On the Features screen, click on the Next button.

Windows 2012 - Features

On the Role service screen, click on the Next button.

IIS - Role Service

On the Summary screen, click on the Install button.

IIS installation summary

Start the application named: IIS Manager.

Start IIS Windows

On the IIS Manager application, select your IIS server name.

On the right part of the screen, access the option named: MIME Types

IIS Mime Types

Add a new file extension named (.pac) using the following MIME type.

Copy to Clipboard

As an example, here is our configuration.

IIS - Proxy Auto-configure script

You have finished the IIS service configuration.

Tutorial Windows – Creating a PAC file

Start the Notepad application and create a Proxy Auto-configuration script, also known as PAC.

Copy to Clipboard

This Proxy PAC file specifies that access to the internal network 192.168.0.0/24 must be direct.

Access to the internal network should not use a Proxy server.

To all other access, the computer must use the Proxy server 192.168.0.1 and the TCP port 3128.

Save the Proxy Auto-configuration script on the root of the IIS server.

Copy to Clipboard

As an example, here is our configuration.

GPO - Proxy PAC

You have finished the creation of the automatic Proxy configuration script.

Tutorial GPO – Automatic Proxy configuration script

On the domain controller, open the group policy management tool.

Windows 2012 - Group Policy Management

Create a new group policy.

Windows 2012 - Group Policy Objects

Enter a name for the new group policy.

Windows - Add GPO

In our example, the new GPO was named: MY-GPO.

On the Group Policy Management screen, expand the folder named Group Policy Objects.

Right-click your new Group Policy Object and select the Edit option.

Windows - Edit GPO

On the group policy editor screen, expand the User configuration folder and locate the following item.

Copy to Clipboard

Right-click on Internet Settings option and create a new configuration item to Internet explorer.

GPO - Proxy configuration

Access the Connections tab and click on the LAN settings button.

Windows Proxy configuration

The green line allows the configuration of each item.

F5 activates all the options on the screen.

F6 activates only the chosen setting.

Make sure the configuration you enter has a green line.

Enter the URL to the Proxy automatic configuration Script.

GPO - Proxy Automatic Configuration script

The system will create a Group preference.

GPO - Automatic Proxy configuration

To save the group policy configuration, you need to close the Group Policy editor.

Congratulations! You have finished the GPO creation.

Tutorial GPO – Configure the Proxy

On the Group policy management screen, you need to right-click the Organizational Unit desired and select the option to link an existent GPO.

Windows-2012-Applocker application

In our example, we are going to link the group policy named MY-GPO to the root of the domain.

GPO- tutorial linking

After applying the GPO you need to wait for 10 or 20 minutes.

During this time the GPO will be replicated to other domain controllers.

To test the configuration, open the Internet Explorer Proxy configuration.

Here is the Proxy configuration screen, before our configuration.

Internet explorer Proxy configuration

Here is the Proxy configuration screen, after our configuration.

GPO - Proxy PAC Script

In our example, the Proxy settings were automatically set using a GPO.